Skip to content

serveTcp

function serveTcp(target, options?): Promise<ServeTcpHandle>;

Defined in: src/launcher/serve-tcp.ts:156

Bind a TCP socket and serve protocol over per-connection IPC streams.

The network analog of serveUnix: same raw Arrow-IPC framing, only the listening socket differs. Nagle’s algorithm is disabled (setNoDelay(true)) on each connection so the lockstep request/response framing is not delayed waiting to coalesce writes.

target is a bare Protocol, or a VgiRpcServer carrying additional protocols (and identity) – the same host object every other transport accepts, so all of them serve one hosted set. With a server, the server-level options here (serverId, protocolVersion, enableDescribe, dispatchHook, externalLocation, onServeStart) must be left unset.

SECURITY: no authentication or TLS — trusted networks only; the default host is loopback (127.0.0.1). Use the HTTP transport for untrusted networks.

Parameter Type
target | Protocol | VgiRpcServer
options ServeTcpOptions

Promise<ServeTcpHandle>