docs: public WebSocket sendFrame(WebSocketFrame frame)
      {
          if (frame == null)
          {
              return this;
          }
  
          synchronized (mStateManager)
          {
              WebSocketState state = mStateManager.getState();
  
              if (state != OPEN && state != CLOSING)
              {
                  return this;
              }
          }
  
          // The current state is either OPEN or CLOSING. Or, CLOSED.
  
          // Get the reference to the writing thread.
          WritingThread wt = mWritingThread;
  
          // Some applications call sendFrame() without waiting for the
          // notification of WebSocketListener.onConnected() (Issue #23),
          // and/or even after the connection is closed. That is, there
          // are chances that sendFrame() is called when mWritingThread
          // is null. So, it should be checked whether an instance of
          // WritingThread is available or not before calling queueFrame().
          if (wt == null)
          {
              // An instance of WritingThread is not available.
              return this;
          }
  
          // Split the frame into multiple frames if necessary.
          List<WebSocketFrame> frames = splitIfNecessary(frame);
  
          // Queue the frame or the frames. Even if the current state is
          // CLOSED, queueing won't be a big issue.
  
          // If the frame was not split.
          if (frames == null)
          {
              // Queue the frame.
              wt.queueFrame(frame);
          }
          else
          {
              for (WebSocketFrame f : frames)
              {
                  // Queue the frame.
                  wt.queueFrame(f);
              }
          }
  
          return this;
      }