docs: private Map<String, List<String>> shakeHands() throws WebSocketException
      {
          // The raw socket created by WebSocketFactory.
          Socket socket = mSocketConnector.getSocket();
  
          // Get the input stream of the socket.
          WebSocketInputStream input = openInputStream(socket);
  
          // Get the output stream of the socket.
          WebSocketOutputStream output = openOutputStream(socket);
  
          // Generate a value for Sec-WebSocket-Key.
          String key = generateWebSocketKey();
  
          // Send an opening handshake to the server.
          writeHandshake(output, key);
  
          // Read the response from the server.
          Map<String, List<String>> headers = readHandshake(input, key);
  
          // Keep the input stream and the output stream to pass them
          // to the reading thread and the writing thread later.
          mInput  = input;
          mOutput = output;
  
          // The handshake succeeded.
          return headers;
      }