code: public int getPort() {
      final Connector[] connectors = this.server.getConnectors();
      checkState(connectors.length >= 1, "Server must have at least 1 connector");
  
      // The first connector is created upon initializing the server. That's the one that has the port.
      return connectors[0].getLocalPort();
    }
docs: Get the current server port
  
  @return the port at which the executor server is running