public int getPort() {
    return port;
  }
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