docs: public WebSocket recreate(int timeout) throws IOException
      {
          if (timeout < 0)
          {
              throw new IllegalArgumentException("The given timeout value is negative.");
          }
  
          WebSocket instance = mWebSocketFactory.createSocket(getURI(), timeout);
  
          // Copy the settings.
          instance.mHandshakeBuilder = new HandshakeBuilder(mHandshakeBuilder);
          instance.setPingInterval(getPingInterval());
          instance.setPongInterval(getPongInterval());
          instance.setPingPayloadGenerator(getPingPayloadGenerator());
          instance.setPongPayloadGenerator(getPongPayloadGenerator());
          instance.mExtended = mExtended;
          instance.mAutoFlush = mAutoFlush;
          instance.mMissingCloseFrameAllowed = mMissingCloseFrameAllowed;
          instance.mDirectTextMessage = mDirectTextMessage;
          instance.mFrameQueueSize = mFrameQueueSize;
  
          // Copy listeners.
          List<WebSocketListener> listeners = mListenerManager.getListeners();
          synchronized (listeners)
          {
              instance.addListeners(listeners);
          }
  
          return instance;
      }