protected Socket connect() throws IOException {

		synchronized (this) {
			if (!connectionPending) {
				throw new IOException("already connected");
			}
			connectionPending = false;
		}

		SocketFactory socketFactory = SSLSocketFactory.getDefault();
		Socket socket = socketFactory.createSocket(streamServerIPAddress, streamServerPort);

		// TODO: set socket options ?

		// write stream connection request info
		OutputStream out = socket.getOutputStream();
		out.write(getStreamRequestHeader().getBytes());
		out.flush();

		return socket;
	}
Invoked by client during the openBlockStream operation and completes the
connection into the server.
@return connected socket
@throws IOException
Ghidra/Features/GhidraServer/src/main/java/ghidra/server/stream/RemoteBlockStreamHandle.java