public abstract class NetworkUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
INVALID_NO_EPHEMERAL_PORT_MESSAGE |
static String |
INVALID_PORT_MESSAGE |
| Constructor and Description |
|---|
NetworkUtils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isValidNonEphemeralPort(int port) |
static boolean |
isValidPort(int port)
Determines whether the given
port is valid. |
public static final String INVALID_PORT_MESSAGE
public static final String INVALID_NO_EPHEMERAL_PORT_MESSAGE
public static boolean isValidPort(int port)
port is valid.
Technically, port 0 is valid too but no client would use port 0 (the ephemeral port) to connect to a service.port - port to evaluate.port is valid or not.public static boolean isValidNonEphemeralPort(int port)
Copyright © 2011–2020 Pivotal Software, Inc.. All rights reserved.