Skip to content

IMultiplexedConnection

Defined in: packages/net-core/src/multiplexed-connection.ts:182

A secure connection carrying many independent streams (QUIC).

Neither a Transport nor a TransportConnection: a protocol over it opens and accepts streams rather than reading one byte stream. The negotiated details mirror TransportConnection so a protocol layer reads them the same way.

readonly alpnProtocol: string | null

Defined in: packages/net-core/src/multiplexed-connection.ts:193

The application protocol ALPN settled on, or null when none was.


readonly closed: boolean

Defined in: packages/net-core/src/multiplexed-connection.ts:196

Whether the connection ended; openStream then rejects.


readonly local: TransportEndpoint | null

Defined in: packages/net-core/src/multiplexed-connection.ts:184

The local end, or null when the carrier has no addresses.


readonly remote: TransportEndpoint | null

Defined in: packages/net-core/src/multiplexed-connection.ts:187

The remote end, or null when the carrier has no addresses.


readonly secure: boolean

Defined in: packages/net-core/src/multiplexed-connection.ts:190

Whether the bytes are protected by TLS (always, over QUIC).

close(code, reason?): Promise<void>

Defined in: packages/net-core/src/multiplexed-connection.ts:218

Close the connection gracefully with an application code: streams still open fail, and the peer learns code and reason. Idempotent.

number

Application error code.

string

Human-readable reason.

Promise<void>

Resolves once the connection ended.


destroy(error?): void

Defined in: packages/net-core/src/multiplexed-connection.ts:225

Tear the connection down at once with the connection’s generic abort code.

unknown

Optional cause, carried by the close event’s error.

void


isSubscribed<K>(event, listener): boolean

Defined in: packages/async/src/events/ievent-dispatcher-map.ts:41

Check if a callback is subscribed to a specific event.

K extends keyof MultiplexedConnectionEvents

K

The event name.

Callable<MultiplexedConnectionEvents[K]>

The callback to check.

boolean

IEventDispatcherMap.isSubscribed


openStream(direction, signal?): Promise<IMultiplexedStream>

Defined in: packages/net-core/src/multiplexed-connection.ts:205

Open a stream.

MultiplexedStreamDirection

Whether the peer may send on it too.

AbortSignal

Abandons the wait.

Promise<IMultiplexedStream>

The stream, once the peer allows one more in that direction.


subscribe<K>(event, listener, options?): Callable | null

Defined in: packages/async/src/events/ievent-dispatcher-map.ts:18

K extends keyof MultiplexedConnectionEvents

K

Callable<MultiplexedConnectionEvents[K]>

EventDispatcherSubscribeOptions

Callable | null

IEventDispatcherMap.subscribe


unsubscribe<K>(event, listener): void

Defined in: packages/async/src/events/ievent-dispatcher-map.ts:30

Unsubscribe a callback from a specific event.

K extends keyof MultiplexedConnectionEvents

K

The event name.

Callable<MultiplexedConnectionEvents[K]>

The callback to remove.

void

IEventDispatcherMap.unsubscribe


wait<K>(event, options?): Promise<MultiplexedConnectionEvents[K]>

Defined in: packages/async/src/events/ievent-dispatcher-map.ts:58

Wait for the next occurrence of a specific event, optionally matching a predicate.

This is a convenience method that subscribes to the dispatcher, waits for the next event that matches the predicate (if provided), and then unsubscribes automatically.

K extends keyof MultiplexedConnectionEvents

K

The event name to wait for.

EventDispatcherWaitOptions<MultiplexedConnectionEvents[K]>

Optional settings including predicate and abort signal.

Promise<MultiplexedConnectionEvents[K]>

A promise that resolves with the event arguments as an array.

IEventDispatcherMap.wait