protected SocketChannel acceptConnection(SelectionKey key) throws SocketException, IOException {
    ServerSocketChannel serverSocketChannel = (ServerSocketChannel) key.channel();
    serverSocketChannel.socket().setReceiveBufferSize(recvBufferSize);
    SocketChannel socketChannel = serverSocketChannel.accept();
    socketChannel.configureBlocking(false);
    socketChannel.socket().setTcpNoDelay(true);
    socketChannel.socket().setSendBufferSize(sendBufferSize);
    logger.trace("Accepted connection from {} on {}. sendBufferSize "
            + "[actual|requested]: [{}|{}] recvBufferSize [actual|requested]: [{}|{}]",
        socketChannel.socket().getInetAddress(), socketChannel.socket().getLocalSocketAddress(),
        socketChannel.socket().getSendBufferSize(), sendBufferSize, socketChannel.socket().getReceiveBufferSize(),
        recvBufferSize);
    return socketChannel;
  }
Accept loop that checks for new connection attempts for a plain text port
ambry-network/src/main/java/com/github/ambry/network/SocketServer.java