/** * Returns the actual ephemeral port used when the listening port is set to * '0'. The default value is '-1' if no ephemeral port is known. See * InetSocketAddress#InetSocketAddress(int) and ServerSocket#getLocalPort() * methods for details. * * @return The actual ephemeral port used. */ public int getEphemeralPort() { return (Integer) getHelper().getAttributes().get("ephemeralPort"); }