Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Transport-layer utilities for ports, connections, and network readiness.
- @sys/net
all symbols
Namespaces
Type library (barrel file).
Type Aliases
Attempt to open a TCP connection to {port} (and optional {hostname}) with retry logic and exponential back-off.
Response from the Net.connect method.
Tools for working with a network.
- Port: t.PortLib
Network port utilities.
- connect(): Promise<t.NetConnectResponse>port: t.PortNumber,options?: t.NetConnectOptions
Attempt a TCP connection with retry and backoff.
- port: t.PortLib["get"]
Retrieve an available port (alias of
Port.get). - toUrl(): stringaddr: Deno.NetAddr,kind?: "http" | "ws"
Format a network address as an http/https or ws/wss URL.
- waitFor(target: NetWaitTarget): Promise<void>
Wait until a network target is ready (e.g. an open WebSocket).
Targets that can be waited on with Net.waitFor.
Starts with WebSocket and can be extended over time.
Tools for working with network ports.
- get(): t.PortNumberpreference?: t.PortNumber,options?: { throw?: boolean; }
Retrieves a port number based on the provided preference or defaults to a pre-selected port.
- inUse(port: t.PortNumber): boolean
Determine if the given port number is currently in use.
- random(): t.PortNumber
Retrieve a random unused port number.
Variables
Type Aliases
Attempt to open a TCP connection to {port} (and optional {hostname}) with retry logic and exponential back-off.
Response from the Net.connect method.
Tools for working with a network.
- Port: t.PortLib
Network port utilities.
- connect(): Promise<t.NetConnectResponse>port: t.PortNumber,options?: t.NetConnectOptions
Attempt a TCP connection with retry and backoff.
- port: t.PortLib["get"]
Retrieve an available port (alias of
Port.get). - toUrl(): stringaddr: Deno.NetAddr,kind?: "http" | "ws"
Format a network address as an http/https or ws/wss URL.
- waitFor(target: NetWaitTarget): Promise<void>
Wait until a network target is ready (e.g. an open WebSocket).
Targets that can be waited on with Net.waitFor.
Starts with WebSocket and can be extended over time.
Tools for working with network ports.
- get(): t.PortNumberpreference?: t.PortNumber,options?: { throw?: boolean; }
Retrieves a port number based on the provided preference or defaults to a pre-selected port.
- inUse(port: t.PortNumber): boolean
Determine if the given port number is currently in use.
- random(): t.PortNumber
Retrieve a random unused port number.