RelayedConn class

RelayedConn is a connection to a remote peer through a relay. It implements the TransportConn interface.

Implemented types

Constructors

RelayedConn({required P2PStream<Uint8List> stream, required CircuitV2Client transport, required PeerId localPeer, required PeerId remotePeer, required MultiAddr localMultiaddr, required MultiAddr remoteMultiaddr, void onClose()?, String? diagnosticSessionId, String? outerConnectionId, String? relayPeerId, int? hopStreamId})

Properties

context → ConnectionContext?
Gets the connection context for event correlation
no setter
diagnosticSessionId → String?
Diagnostic session ID for cross-node correlation
final
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
isClosed → bool
IsClosed returns whether a connection is fully closed, so it can be garbage collected.
no setteroverride
localMultiaddr → MultiAddr
LocalMultiaddr returns the local Multiaddr associated with this connection
no setteroverride
localPeer → PeerId
LocalPeer returns our peer ID
no setteroverride
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
socket → Socket
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>>
GetStreams returns all open streams over this conn.
no setteroverride

Methods

close() → Future<void>
Closes the connection
override
closeRead() → Future<void>
Closes the read side of the relayed connection (half-close support) This signals that we won't read any more data from the remote peer.
closeWrite() → Future<void>
Closes the write side of the relayed connection (half-close support) This allows the remote peer to finish sending data while signaling that we won't send any more data.
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
notifyActivity() → void
Notifies that activity has occurred on this transport connection, potentially due to activity on a multiplexed stream over it. This can be used by multiplexers to inform the connection manager.
override
read([int? maxLength]) → Future<Uint8List>
Reads data from the connection. If length is provided, reads exactly that many bytes. Otherwise, reads whatever is available.
override
setReadTimeout(Duration timeout) → void
Sets a timeout for read operations.
override
setWriteTimeout(Duration timeout) → void
Sets a timeout for write operations.
override
toString() → String
A string representation of this object.
inherited
write(Uint8List data) → Future<void>
Writes data to the connection.
override

Operators

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