public Socket createSocket() throws IOException {
    Socket tcpSocket = new Socket();

    if (readBufferSize > 0) {
      tcpSocket.setReceiveBufferSize(readBufferSize);
    }
    if (writeBufferSize > 0) {
      tcpSocket.setSendBufferSize(writeBufferSize);
    }
    tcpSocket.setSoTimeout(readTimeoutMs);
    tcpSocket.setKeepAlive(true);
    tcpSocket.setTcpNoDelay(enableTcpNoDelay);
    tcpSocket.connect(new InetSocketAddress(host, port), connectTimeoutMs);

    logger.debug("Created socket with SO_TIMEOUT = {} (requested {}), "
            + "SO_RCVBUF = {} (requested {}), SO_SNDBUF = {} (requested {})", tcpSocket.getSoTimeout(), readTimeoutMs,
        tcpSocket.getReceiveBufferSize(), readBufferSize, tcpSocket.getSendBufferSize(), writeBufferSize);

    return tcpSocket;
  }
Creates and connects a Socket
@return Socket
@throws IOException
ambry-network/src/main/java/com/github/ambry/network/BlockingChannel.java