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.
Extends
Section titled “Extends”Properties
Section titled “Properties”direction
Section titled “direction”
readonlydirection:MultiplexedStreamDirection
Defined in: packages/net-core/src/multiplexed-connection.ts:126
readonlyid:number
Defined in: packages/net-core/src/multiplexed-connection.ts:124
The stream’s identifier, unique within its connection.
initiator
Section titled “initiator”
readonlyinitiator:MultiplexedStreamInitiator
Defined in: packages/net-core/src/multiplexed-connection.ts:128
readonlymode:TransportMode
Defined in: packages/net-core/src/transport.ts:58
Whether bytes arrive as a stream or as discrete messages.
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”destroy()
Section titled “destroy()”destroy(
error?):void
Defined in: packages/net-core/src/transport.ts:113
Tear the transport down immediately, discarding pending I/O.
Parameters
Section titled “Parameters”error?
Section titled “error?”unknown
Optional cause, propagated to TransportHandlers.error where the transport supports it.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”end():
Promise<void>
Defined in: packages/net-core/src/transport.ts:105
Half-close the outbound direction and resolve once flushed.
Returns
Section titled “Returns”Promise<void>
Resolves when all pending writes have been sent.
Inherited from
Section titled “Inherited from”pause()
Section titled “pause()”pause():
void
Defined in: packages/net-core/src/transport.ts:95
Stop delivering [“data”] until resume.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”reset()
Section titled “reset()”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.
Parameters
Section titled “Parameters”number
Application error code.
Returns
Section titled “Returns”void
resume()
Section titled “resume()”resume():
void
Defined in: packages/net-core/src/transport.ts:98
Resume delivery suspended by pause.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”setWriteCoalescing()?
Section titled “setWriteCoalescing()?”
optionalsetWriteCoalescing(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.
Parameters
Section titled “Parameters”enabled
Section titled “enabled”boolean
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”start()
Section titled “start()”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.
Parameters
Section titled “Parameters”handlers
Section titled “handlers”Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”stop()
Section titled “stop()”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.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”stopSending()
Section titled “stopSending()”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.
Parameters
Section titled “Parameters”number
Application error code.
Returns
Section titled “Returns”void
write()
Section titled “write()”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.
Parameters
Section titled “Parameters”buffers
Section titled “buffers”readonly Uint8Array<ArrayBufferLike>[]
Ordered payload fragments.
signal?
Section titled “signal?”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.
Returns
Section titled “Returns”Promise<void>
Resolves once the transport has accepted the bytes and any backpressure has cleared.