Skip to content
DocsTry Aspire
DocsTry

PortAllocator Constructors

ClassConstructors1 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)
{
// ...
}
}
startPortintoptional
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.