protected void run() {

    while (!shuttingDown) {
      if (srv_sock.isClosed()) {
        shuttingDown = true;
        break;
      }
      try {
        final Socket sock;
        try {
          sock = srv_sock.accept();
        } catch (SSLException ex) {
          // SW: This is the case when there is a problem in locator
          // SSL configuration, so need to exit otherwise goes into an
          // infinite loop just filling the logs
          logger.error("Locator stopping due to SSL configuration problem.", ex);
          shuttingDown = true;
          continue;
        }

        processRequest(sock);
      } catch (Exception ex) {
        if (!shuttingDown) {
          logger.error("exception=", ex);
        }
      }
    }

    if (!srv_sock.isClosed()) {
      try {
        srv_sock.close();
      } catch (java.io.IOException ex) {
        logger.warn("exception closing server socket during shutdown", ex);
      }
    }

    if (shuttingDown) {
      logger.info("locator shutting down");
      executor.shutdown();
      try {
        executor.awaitTermination(SHUTDOWN_WAIT_TIME, TimeUnit.MILLISECONDS);
      } catch (InterruptedException ignore) {
        Thread.currentThread().interrupt();
      }
      handler.shutDown();
      synchronized (this) {
        notifyAll();
      }
    }
  }
Returns the value of the bound port. If the server was initialized with a port of 0 indicating
that any ephemeral port should be used, this method will return the actual bound port.

@return the locator's tcp/ip port. This will be zero if the TcpServer hasn't been started.
geode-tcp-server/src/main/java/org/apache/geode/distributed/internal/tcpserver/TcpServer.java