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 ( ) ; }
Get the current server port