Пример #1
0
  public void stopSearch() {
    Log.d(TAG, "Stop search");
    mStarted = false;
    mStopped = true;
    leaveGroup(mMulticastAddress);
    NetWorkUtil.releaseWifiMultiCastLock();

    closeSocket();
    mInstance = null;
  }
Пример #2
0
 public void startSearch() {
   Log.d(TAG, "Start search.");
   if (mStarted) {
     Log.d(TAG, "startSearch() ignore, search is already started.");
     return;
   }
   mStarted = true;
   NetWorkUtil.acquireWifiMultiCastLock(mContext);
   Thread searchThread = new Thread(this);
   searchThread.start();
 }