|
static int | FindOpenPort () |
| Attempts to find a random unbound port on the loopback device (localhost) within the range 1024-65535.
|
static int | FindOpenPort (IPAddress forAddress) |
| Attempts to find an unbound port on the provided ip address within the range 1024-65535.
|
static int | FindOpenPort (IPAddress forAddress, int min, int max) |
| Attempts to find an unbound port on the provided ip address within the provided range.
|
static int | FindOpenPort (IPAddress forAddress, int min, int max, Action< string > attemptLogger) |
| Attempts to find an unbound port on the provided ip address within the provided range.
|
static void | ResetUsedHistory () |
| PortFinder will store ports which have been handed out before so as to avoid race conditions between contenders. Ordinarily, this shouldn't be a problem - there are 64k ports to choose from - but if you are sure you don't mind a conflict and have the need to, you can reset the used history here.
|
static int | FindOpenPort (IPAddress forAddress, int min, int max, Func< int, int, int, int > portAttemptGenerator) |
| Attempts to find an unbound port on the provided ip address within the provided range using the provided port attempt generator The portAttemptGenerator callback is called with 3 arguments:
|
static int | FindOpenPortFrom (int start) |
| Attempt to find an open port on the ipv4 loopback interface (localhost / 127.0.0.1), starting at the provided value and sequentially testing ports in order, until one can (probably) be used.
|
static int | FindOpenPortFrom (IPAddress forAddress, int start) |
| Attempt to find an open port, starting at the provided value and sequentially testing ports in order, until one can (probably) be used.
|
static int | FindOpenPort (IPAddress forAddress, int min, int max, Func< int, int, int, int > portAttemptGenerator, Action< string > attemptLogger) |
| Attempts to find an unbound port on the provided ip address within the provided range using the provided port attempt generator The portAttemptGenerator callback is called with 3 arguments:
|
static bool | PortIsActivelyInUse (int port) |
| Tests if the provided port is currently bound on the loopback device (localhost)
|
static bool | PortIsActivelyInUse (IPAddress forAddress, int port) |
| Tests if the provided port is currently bound on the provided device.
|
Utility class to find open ports for binding to.