Skip to content

Function: allocateDynamicPorts() ​

ts
function allocateDynamicPorts(portNames): Promise<Readonly<Record<string, number>>>;

Defined in: node/src/executors/internal/daemon-ports-and-scope-key.ts:59

Allocates distinct, conflict-free dynamic TCP ports for all named .port(name) entries on a daemon.

Uses getPort combined with the in-process ACTIVE_LEASED_DAEMON_PORTS reservation set so concurrent daemon startups before socket bind never collide on the same ephemeral port.

Parameters ​

ParameterTypeDescription
portNamesreadonly string[]Declared port names on LocalServiceNode.

Returns ​

Promise<Readonly<Record<string, number>>>

Frozen map from port name to allocated TCP port.

Throws ​

If any declared port cannot be allocated conflict-free.

Released under the MIT License.