Skip to content
Docs Try Aspire

IPortAllocator Methods

Interface Methods 2 members
Provides port allocation functionality for resources.
AddUsedPort(int) Section titled AddUsedPort(int) abstract
Marks a port as used to prevent it from being allocated.
public interface IPortAllocator
{
public abstract void AddUsedPort(
int port)
{
// ...
}
}
port int The port number to mark as used.
AllocatePort Section titled AllocatePort abstract int
Allocates a port that is not currently in use.
public interface IPortAllocator
{
public abstract int AllocatePort()
{
// ...
}
}
int An available port number.