Class ReservedPorts

java.lang.Object
org.terracotta.utilities.test.net.ReservedPorts

public final class ReservedPorts extends Object
Identifies reserved ports on a platform.

More recent releases of Microsoft Windows has the ability, by API or command, to reserve a port for use by an application. While typical usage would be to reserve an ephemeral/dynamic port, reservation is not restricted to these ports so reserved ports need to be avoided in PortManager processing.

  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
  • Constructor Details

    • ReservedPorts

      public ReservedPorts()
  • Method Details

    • getRange

      static List<EphemeralPorts.Range> getRange()
      Gets the list of port ranges considered reserved by the platform.

      This list is calculated for each call to this method; since determining the list of reserved ports is likely to be expensive, repeated calls should be avoided.

      Returns:
      a list, possibly empty, of reserved port ranges
    • main

      public static void main(String[] args)