Whether this connection is direct or, for example, is via a relay
Outbound connections are opened by the local node, inbound streams are opened by the remote
OptionalencryptionThe encryption protocol negotiated for this connection
The unique identifier for this connection
OptionallimitsIf present, this connection has limits applied to it, perhaps by an intermediate relay. Once the limits have been reached the connection will be closed by the relay.
The connection logger, used to log connection-specific information
OptionalmultiplexerThe multiplexer negotiated for this connection
The address of the remote end of the connection
The id of the peer at the remote end of the connection
OptionalrttThe time in milliseconds it takes to make a round trip to the remote peer.
This is updated periodically by the connection monitor.
The current status of the connection
A list of open streams on this connection
When stream life cycle events occurred
Immediately close the connection. Any data queued to be sent or read will be discarded.
The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.
Optionaloptions: boolean | AddEventListenerOptionsGracefully close the connection. The returned promise will resolve when all queued data has been written to the underlying transport. Any unread data will still be emitted as a 'message' event.
Optionaloptions: AbortOptionsThe dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().
The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().
Create a new stream on this connection and negotiate one of the passed protocols
Optionaloptions: NewStreamOptionsThe removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.
Optionallistener: EventHandler<Omit<MessageStreamEvents, "drain" | "message">[K]> | nullOptionaloptions: boolean | EventListenerOptionsThe removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.
Optionallistener: EventHandler<Event>Optionaloptions: boolean | EventListenerOptions
A Connection is a high-level representation of a connection to a remote peer that may have been secured by encryption and multiplexed, depending on the configuration of the nodes between which the connection is made.