Package org.httpobjects.tck
Class PortFinder
java.lang.Object
org.httpobjects.tck.PortFinder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PortAllocationallocateFreePort(Object context) WARNING: there is no guarantee that the port is still free after this has returned ... so, if your code makes that assumption, there is an inherent race condition.static int
-
Constructor Details
-
PortFinder
public PortFinder()
-
-
Method Details
-
usedPorts
-
findFreePort
public static int findFreePort() -
allocateFreePort
WARNING: there is no guarantee that the port is still free after this has returned ... so, if your code makes that assumption, there is an inherent race condition. Finds a port that was free at the time of allocation. Tries to find ports that the underlying system wants us to use. The availablility of the allocated ports is verified by starting and stopping a server on that port.
-