Skip to content

IMultiplexedStream

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

One stream of a IMultiplexedConnection: an ordered, reliable byte stream with its own flow control, which either side can abort without affecting the others.

Each direction ends on its own: Transport.end finishes the sending side, reset abandons it, stopSending abandons the receiving side. A unidirectional stream has only one of them — a locally opened one never delivers data, and writing to a remotely opened one rejects.

Transport.destroy abandons both directions with the connection’s generic abort code.

readonly direction: MultiplexedStreamDirection

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


readonly id: number

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

The stream’s identifier, unique within its connection.


readonly initiator: MultiplexedStreamInitiator

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


readonly mode: TransportMode

Defined in: packages/net-core/src/transport.ts:58

Whether bytes arrive as a stream or as discrete messages.

Transport.mode

destroy(error?): void

Defined in: packages/net-core/src/transport.ts:113

Tear the transport down immediately, discarding pending I/O.

unknown

Optional cause, propagated to TransportHandlers.error where the transport supports it.

void

Transport.destroy


end(): Promise<void>

Defined in: packages/net-core/src/transport.ts:105

Half-close the outbound direction and resolve once flushed.

Promise<void>

Resolves when all pending writes have been sent.

Transport.end


pause(): void

Defined in: packages/net-core/src/transport.ts:95

Stop delivering [“data”] until resume.

void

Transport.pause


reset(code): void

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

Abandon the sending side: unsent bytes are discarded, pending writes reject, and the peer learns code (QUIC RESET_STREAM). Does nothing once the sending side ended.

number

Application error code.

void


resume(): void

Defined in: packages/net-core/src/transport.ts:98

Resume delivery suspended by pause.

void

Transport.resume


optional setWriteCoalescing(enabled): void

Defined in: packages/net-core/src/transport.ts:123

Whether a small write may be held back briefly so it leaves together with later ones — Nagle’s algorithm on TCP. A protocol whose exchanges wait on small messages turns it off; a bulk transfer gains nothing from either.

Omitted by transports that never hold writes back (datagrams, a stream multiplexed over another connection), where there is nothing to turn off.

boolean

void

Transport.setWriteCoalescing


start(handlers): void

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

Begin delivering data to handlers, which may also follow the peer abandoning what this side sends.

MultiplexedStreamHandlers

void

Transport.start


stop(): void

Defined in: packages/net-core/src/transport.ts:76

Detach the installed handlers without closing the transport.

Used when handing an already-connected transport to another consumer, as in an HTTP Upgrade. Contrast with destroy, which tears the transport down.

void

Transport.stop


stopSending(code): void

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

Abandon the receiving side: no more data is delivered and the peer is asked to stop sending with code (QUIC STOP_SENDING). Does nothing once the receiving side ended.

number

Application error code.

void


write(buffers, signal?): Promise<void>

Defined in: packages/net-core/src/transport.ts:92

Write buffers as a single logical unit and resolve once accepted.

Fragments are written in order and, where the transport supports it, coalesced into one vectored write. In message mode the buffers form exactly one outbound message.

readonly Uint8Array<ArrayBufferLike>[]

Ordered payload fragments.

AbortSignal

Cancels the wait for capacity. Note that bytes already handed to the transport cannot be unsent; aborting rejects the caller but does not retract the write.

Promise<void>

Resolves once the transport has accepted the bytes and any backpressure has cleared.

Transport.write