Skip to content
Docs Try Aspire

PortAllocator Constructors

Class Constructors 1 member
Allocates and manages a range of ports for use in an application context.
Allocates and manages a range of ports for use in an application context.
public sealed class PortAllocator
{
public PortAllocator(
int startPort = 8000)
{
// ...
}
}
startPort int optional
This class starts allocating ports from a specified initial port (default is 8000) and ensures that allocated ports do not overlap with ports already marked as used.