Class ReservedPorts
java.lang.Object
org.terracotta.utilities.test.net.ReservedPorts
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classDetermine the reserved ports on a Linux platform.private static classDetermine the reserved ports on a Windows platform. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static List<EphemeralPorts.Range>getRange()Gets the list of port ranges considered reserved by the platform.static void
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
-
Constructor Details
-
ReservedPorts
public ReservedPorts()
-
-
Method Details
-
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
-