docs: private void processSSC(ServerSocketChannel ssc) throws Exception {
          SocketChannel sc = null;
          while ((sc = ssc.accept()) != null) {
              boolean success = false;
              try {
                  sc.socket().setTcpNoDelay(true);
                  sc.socket().setPerformancePreferences(0, 2, 1);
                  SslHandshakeResult result = initializeSocket(sc, false, null);
                  SSLEngine sslEngine = result.m_sslEngine;
                  final String remoteAddress = sc.socket().getRemoteSocketAddress().toString();
  
                  MessagingChannel messagingChannel = MessagingChannel.get(sc, sslEngine);
  
                  /*
                   * Read a length prefixed JSON message
                   */
                  JSONObject jsObj;
                  if (result.m_remnant != null) {
                      assert result.m_remnant.getInt() == result.m_remnant.remaining()
                              && result.m_remnant.hasArray() : "Remnant not array or not a single full message. remnant: "
                                      + result.m_remnant + ", expected length: "
                                      + result.m_remnant.getInt(result.m_remnant.position() - Integer.BYTES);
  
                      jsObj = new JSONObject(new String(result.m_remnant.array(),
                              result.m_remnant.arrayOffset() + result.m_remnant.position(), result.m_remnant.remaining(),
                              StandardCharsets.UTF_8));
                  } else {
                      jsObj = readJSONObjFromWire(messagingChannel);
                  }
  
                  LOG.info(jsObj.toString(2));
  
                  // get the connecting node's version string
                  String remoteBuildString = jsObj.getString(VERSION_STRING);
  
                  VersionChecker versionChecker = m_acceptor.getVersionChecker();
                  // send a response with version/build data of this node
                  JSONObject returnJs = new JSONObject();
                  returnJs.put(VERSION_STRING, versionChecker.getVersionString());
                  returnJs.put(BUILD_STRING, versionChecker.getBuildString());
                  returnJs.put(VERSION_COMPATIBLE,
                          versionChecker.isCompatibleVersionString(remoteBuildString));
  
                  // inject acceptor fields
                  returnJs = m_acceptor.decorate(returnJs, Optional.of(m_paused.get()));
                  byte jsBytes[] = returnJs.toString(4).getBytes(StandardCharsets.UTF_8);
  
                  ByteBuffer returnJsBuffer = ByteBuffer.allocate(4 + jsBytes.length);
                  returnJsBuffer.putInt(jsBytes.length);
                  returnJsBuffer.put(jsBytes).flip();
                  messagingChannel.writeMessage(returnJsBuffer);
  
                  /*
                   * The type of connection, it can be a new request to join the cluster
                   * or a node that is connecting to the rest of the cluster and publishing its
                   * host id or a request to add a new connection to the request node.
                   */
                  String type = jsObj.getString(TYPE);
  
                  /*
                   * The new connection may specify the address it is listening on,
                   * or it can be derived from the connection itself
                   */
                  InetSocketAddress listeningAddress;
                  if (jsObj.has(ADDRESS)) {
                      listeningAddress = new InetSocketAddress(
                              InetAddress.getByName(jsObj.getString(ADDRESS)),
                              jsObj.getInt(PORT));
                  } else {
                      listeningAddress =
                          new InetSocketAddress(
                                  ((InetSocketAddress)sc.socket().
                                          getRemoteSocketAddress()).getAddress().getHostAddress(),
                                          jsObj.getInt(PORT));
                  }
  
                  hostLog.info("Received request type " + type);
                  if (type.equals(ConnectionType.REQUEST_HOSTID.name())) {
                      m_joinHandler.requestJoin(sc, sslEngine, messagingChannel, listeningAddress, jsObj);
                  } else if (type.equals(ConnectionType.PUBLISH_HOSTID.name())){
                      m_joinHandler.notifyOfJoin(jsObj.getInt(HOST_ID), sc, sslEngine, listeningAddress, jsObj);
                  } else if (type.equals(ConnectionType.REQUEST_CONNECTION.name())) {
                      m_joinHandler.notifyOfConnection(jsObj.getInt(HOST_ID), sc, sslEngine, listeningAddress);
                  } else {
                      throw new RuntimeException("Unexpected message type " + type + " from " + remoteAddress);
                  }
                  success = true;
              } catch (IOException e) {
                  LOG.info("IOException occurred while handling new client connection " + sc
                          + ". Client will most likely retry: " + e);
                  if (LOG.isDebugEnabled()) {
                      LOG.debug("", e);
                  }
              } finally {
                  // do not leak sockets when exception happens
                  if (!success) {
                      try {
                          sc.close();
                      } catch (IOException ioex) {
                          // ignore the close exception on purpose
                      }
                  }
              }
  
          }
      }