public void run() {
    try {
      startupComplete();
      while (isRunning()) {
        // setup any new connections that have been queued up
        configureNewConnections();
        // register any new responses for writing
        processNewResponses();
        selector.poll(pollTimeoutMs);

        // handle completed receives
        List<NetworkReceive> completedReceives = selector.completedReceives();
        for (NetworkReceive networkReceive : completedReceives) {
          String connectionId = networkReceive.getConnectionId();
          ByteBuf buffer = networkReceive.getReceivedBytes().content();
          SocketServerRequest req = new SocketServerRequest(id, connectionId, buffer);
          channel.sendRequest(req);
        }
      }
    } catch (Exception e) {
      logger.error("Error in processor thread", e);
    } finally {
      logger.debug("Closing server socket and selector.");
      try {
        closeAll();
        shutdownComplete();
        super.shutdown();
      } catch (InterruptedException ie) {
        metrics.processorShutDownErrorCount.inc();
        logger.error("InterruptedException on processor shutdown ", ie);
      }
    }
  }
Thread that processes all requests from a single connection. There are N of these running in parallel
each of which has its own selectors
ambry-network/src/main/java/com/github/ambry/network/SocketServer.java