public class PortProber
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static EphemeralPortRangeDetector |
ephemeralRangeDetector |
static int |
HIGHEST_PORT |
private static java.util.Random |
random |
static int |
START_OF_USER_PORTS |
Modifier | Constructor and Description |
---|---|
private |
PortProber() |
Modifier and Type | Method and Description |
---|---|
private static int |
checkPortIsFree(int port) |
private static int |
createAcceptablePort()
Returns a port that is within a probable free range.
|
static int |
findFreePort() |
static boolean |
pollPort(int port) |
static boolean |
pollPort(int port,
int timeout,
java.util.concurrent.TimeUnit unit) |
static void |
waitForPortUp(int port,
int timeout,
java.util.concurrent.TimeUnit unit) |
private static final java.util.Random random
private static final EphemeralPortRangeDetector ephemeralRangeDetector
public static final int HIGHEST_PORT
public static final int START_OF_USER_PORTS
public static int findFreePort()
private static int createAcceptablePort()
private static int checkPortIsFree(int port)
public static boolean pollPort(int port)
public static boolean pollPort(int port, int timeout, java.util.concurrent.TimeUnit unit)
public static void waitForPortUp(int port, int timeout, java.util.concurrent.TimeUnit unit)