Returns the port number the server is listening on. This can return -1 if there is no actual port or the result otherwise doesn't make sense. The result is undefined after the server is terminated. If there are multiple possible ports, this will return one arbitrarily. Implementations are encouraged to return the same port on each call.
Throws
– if the server has not yet been started.