Class ReservedPorts
- java.lang.Object
-
- org.terracotta.utilities.test.net.ReservedPorts
-
public final class ReservedPorts extends java.lang.ObjectIdentifies 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
PortManagerprocessing.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classReservedPorts.LinuxDetermine the reserved ports on a Linux platform.private static classReservedPorts.WindowsDetermine the reserved ports on a Windows platform.
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.LoggerLOGGER
-
Constructor Summary
Constructors Constructor Description ReservedPorts()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static java.util.List<EphemeralPorts.Range>getRange()Gets the list of port ranges considered reserved by the platform.static voidmain(java.lang.String[] args)
-
-
-
Method Detail
-
getRange
static java.util.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(java.lang.String[] args)
-
-