Abstract
Private
Readonly
closedOutbound streams are opened by the local node, inbound streams are opened by the remote
Private
endUnique identifier for a stream. Identifiers are not unique across muxers.
Readonly
logThe stream logger
User defined stream metadata
Private
Optional
Readonly
onPrivate
Optional
Readonly
onPrivate
Optional
Readonly
onPrivate
Optional
Readonly
onOptional
err: ErrorPrivate
Optional
Readonly
onOptional
protocolThe protocol negotiated for this stream
The current status of the readable end of the stream
Private
Readonly
sendPrivate
Optional
sendingPrivate
Readonly
sinkPrivate
Readonly
sinkThe current status of the stream
Private
Readonly
streamLifecycle times for the stream
The current status of the writable end of the stream
Optional
err: ErrorOptional
err: ErrorOptional
err: ErrorClose immediately for reading and writing and send a reset message (local error)
Closes the stream for reading and writing.
Any buffered data in the source can still be consumed and the stream will end normally.
This will cause a CLOSE
message to be sent to the remote, unless the sink has already ended.
The sink and the source will return normally.
Optional
options: AbortOptionsCloses the stream for reading. If iterating over the source of this stream in a for await of
loop, it will return (exit the loop) after any buffered data has been consumed.
This function is called automatically by the muxer when it receives a CLOSE
message from the remote.
The source will return normally, the sink will continue to consume.
Closes the stream for writing. If iterating over the source of this stream in a for await of
loop, it will return (exit the loop) after any buffered data has been consumed.
The source will return normally, the sink will continue to consume.
Protected
onOptional
err: ErrorProtected
onOptional
err: ErrorAbstract
sendSend a message to the remote muxer, informing them no more data messages will be read by this end of the stream
Optional
options: AbortOptionsAbstract
sendSend a message to the remote muxer, informing them no more data messages will be sent by this end of the stream
Optional
options: AbortOptionsAbstract
sendSend a data message to the remote muxer
Optional
options: AbortOptionsAbstract
sendSend a message to the remote muxer informing them a new stream is being opened
Optional
options: AbortOptionsAbstract
sendSend a reset message to the remote muxer
Optional
options: AbortOptionsWhen an extending class reads data from it's implementation-specific source, call this method to allow the stream consumer to read the data.
A Stream is a data channel between two peers that can be written to and read from at both ends.
It may be encrypted and multiplexed depending on the configuration of the nodes.