YamuxSession class

Yamux session that implements the Multiplexer and MuxedConn interfaces

Implemented types

Constructors

YamuxSession.new(TransportConn _connection, MultiplexerConfig _config, bool _isClient, [PeerScope? _peerScope])

Properties

canCreateStream bool
Returns true if we can create more streams
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
id String
ID returns an identifier that uniquely identifies this Conn within this host, during this run. Connection IDs may repeat across restarts.
no setteroverride
incomingStreams Stream<P2PStream>
Event stream for new inbound streams
no setteroverride
isClosed bool
Returns true if the multiplexer is closed
no setteroverride
localMultiaddr MultiAddr
LocalMultiaddr returns the local Multiaddr associated with this connection
no setteroverride
localPeer PeerId
LocalPeer returns our peer ID
no setteroverride
maxStreams int
The maximum number of concurrent streams allowed
no setteroverride
numStreams int
The current number of active streams
no setteroverride
protocolId String
The protocol ID for this multiplexer (e.g., '/yamux/1.0.0')
final
remoteMultiaddr MultiAddr
RemoteMultiaddr returns the remote Multiaddr associated with this connection
no setteroverride
remotePeer PeerId
RemotePeer returns the peer ID of the remote peer.
no setteroverride
remotePublicKey Future<PublicKey?>
RemotePublicKey returns the public key of the remote peer.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scope ConnScope
Scope returns the user view of this connection's resource scope
no setteroverride
stat ConnStats
Stat stores metadata pertaining to this conn.
no setteroverride
state ConnState
ConnState returns information about the connection state.
no setteroverride
streams Future<List<P2PStream>>
Returns all active streams
no setteroverride

Methods

acceptStream() Future<YamuxStream>
Accepts an inbound stream
override
close() Future<void>
Closes the multiplexer and all its streams
override
newConnOnTransport(TransportConn secureConnection, bool isServer, PeerScope scope) Future<MuxedConn>
Establishes a new multiplexed connection over an existing transport connection.
override
newStream(Context context) Future<P2PStream>
NewStream constructs a new Stream over this conn.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openStream(Context context) Future<MuxedStream>
Creates a new stream.
override
removeStreamHandler() → void
Removes the stream handler
override
setStreamHandler(Future<void> handler(P2PStream stream)) → void
Sets the stream handler for accepting new streams
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited