PortAllocator Methods
ClassMethods2 members
Allocates and manages a range of ports for use in an application context.
AddUsedPort(int)Section titled AddUsedPort(int) Marks a port as used to prevent it from being allocated.
public sealed class PortAllocator{ public void AddUsedPort( int port) { // ... }}Parameters
portintThe port number to mark as used. Allocates a port that is not currently in use.
public sealed class PortAllocator{ public int AllocatePort() { // ... }}Returns
intAn available port number.