public void shutdown() {
    try {
      logger.info("Shutting down socket server");
      for (Acceptor acceptor : acceptors) {
        if (acceptor != null) {
          acceptor.shutdown();
        }
      }
      for (Processor processor : processors) {
        processor.shutdown();
      }
      logger.info("Shutdown socket server completed");
      requestResponseChannel.shutdown();
    } catch (Exception e) {
      logger.error("Error shutting down socket server ", e);
    }
  }
A NIO socket server. The threading model is
  1 Acceptor thread that handles new connections
  N Processor threads that each have their own selector and read requests from sockets
  M Handler threads that handle requests and produce responses back to the processor threads for writing.
ambry-network/src/main/java/com/github/ambry/network/SocketServer.java