Package ffx.utilities
Class PortUtils
java.lang.Object
ffx.utilities.PortUtils
Port Utilities.
- Since:
- 1.0
- Author:
- Michael J. Schnieders
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isTcpPortAvailable
(int port) Check if a port is available.static boolean
tcpPortValid
(int port) Check if an int matches a valid TCP port (i.e. is a 16-bit unsigned integer).
-
Field Details
-
MAX_TCP_PORT
public static final int MAX_TCP_PORTThe maximum TCP Port.MAX_TCP_PORT=65535
- See Also:
-
-
Method Details
-
isTcpPortAvailable
public static boolean isTcpPortAvailable(int port) Check if a port is available.- Parameters:
port
- The port id.- Returns:
- True if the port is available.
-
tcpPortValid
public static boolean tcpPortValid(int port) Check if an int matches a valid TCP port (i.e. is a 16-bit unsigned integer).- Parameters:
port
- A number to check.- Returns:
- If port ≥ 0 and ≤ 65535
-