Package ffx.utilities

Class PortUtils

java.lang.Object
ffx.utilities.PortUtils

public class PortUtils extends Object
Port Utilities.
Since:
1.0
Author:
Michael J. Schnieders
  • Field Details

    • MAX_TCP_PORT

      public static final int MAX_TCP_PORT
      The 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