PeerConnection class
Represents a TCP connection to a BitcoinSV peer
Constructors
- PeerConnection({required String address, required int port, required BitcoinNetwork network, PeerConnectionConfig? config, Logger? logger})
Properties
- address → String
-
final
- bytesReceived → int
-
no setter
- bytesSent → int
-
no setter
- config → PeerConnectionConfig
-
final
- connectedAt → DateTime?
-
Connection statistics
no setter
-
errorStream
→ Stream<
NetworkException> -
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isConnected → bool
-
Whether currently connected
no setter
- logger → Logger
-
final
- messagesReceived → int
-
no setter
- messagesSent → int
-
no setter
-
messageStream
→ Stream<
WireMessage> -
Event streams
no setter
- network → BitcoinNetwork
-
final
- port → int
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
sendLoopCompleter
→ Future<
void> -
no setter
- sendLoopRunning → bool
-
no setter
- state → ConnectionState
-
Current connection state
no setter
-
stateStream
→ Stream<
ConnectionState> -
no setter
Methods
-
close(
) → Future< void> - Close the connection and clean up resources
-
connect(
) → Future< void> - Connect to the peer
-
disconnect(
) → Future< void> - Disconnect from the peer
-
getQueueStats(
) → Map< String, dynamic> - Get queue statistics
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sendMessage(
WireMessage message) → Future< void> - Send a message to the peer
-
setSocket(
Socket socket) → void -
setState(
ConnectionState newState) → void -
startSendLoop(
) → void -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited