code: private void stopThreads(long closeDelay)
      {
          ReadingThread readingThread;
          WritingThread writingThread;
  
          synchronized (mThreadsLock)
          {
              readingThread = mReadingThread;
              writingThread = mWritingThread;
  
              mReadingThread = null;
              mWritingThread = null;
          }
  
          if (readingThread != null)
          {
              readingThread.requestStop(closeDelay);
          }
  
          if (writingThread != null)
          {
              writingThread.requestStop();
          }
      }
docs: Stop both the reading thread and the writing thread.
  
  <p>
  The reading thread will call {@link #onReadingThreadFinished(WebSocketFrame)}
  as its last step. Likewise, the writing thread will call {@link
  #onWritingThreadFinished(WebSocketFrame)} as its last step.
  After both the threads have stopped, {@link #onThreadsFinished()}
  is called.
  </p>