@Override
  public void connect() throws IOException {
    synchronized (this) {
      if (!connected) {

        socket = createSocket();

        writeChannel = Channels.newChannel(socket.getOutputStream());
        readChannel = socket.getInputStream();

        connected = true;

        logger.debug("Connection established to {}({}):{}", host, socket.getRemoteSocketAddress(), socket.getPort());

      }
    }
  }
Connect a socket and create writeChannel (WriteByteChannel) and readChannel (InputStream)

@throws IOException
ambry-network/src/main/java/com/github/ambry/network/BlockingChannel.java