Skip to content

Function: waitForTcpPortReady() ​

ts
function waitForTcpPortReady(
   port, 
   timeoutMs?, 
   signal?
): Promise<void>;

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

Waits for 127.0.0.1:port to accept TCP connections via wait-on or rejects on timeout/abort.

Verifies that a daemon's declared .port() socket is actively listening before resolving service startup.

Parameters ​

ParameterTypeDefault valueDescription
portnumberundefinedTarget TCP port number on 127.0.0.1.
timeoutMs?numberDEFAULT_DAEMON_PORT_READY_TIMEOUT_MSMaximum wait duration in milliseconds.
signal?AbortSignalundefinedOptional abort signal cancelling readiness polling.

Returns ​

Promise<void>

Resolves once a TCP connection to port succeeds.

Throws ​

If signal aborts or port does not accept connections within timeoutMs.

Released under the MIT License.