@Override
  public void close() {
    release();
    clearReceive();
    clearSend();
    key.attach(null);
    key.cancel();
    try {
      socketChannel.socket().close();
      socketChannel.close();
    } catch (IOException e) {
      metrics.selectorCloseSocketErrorCount.inc();
      logger.error("Exception closing connection to node {}:", getConnectionId(), e);
    }
  }
Close the connection for the socket channel
ambry-network/src/main/java/com/github/ambry/network/PlainTextTransmission.java