BoltClient class abstract

A client for connecting to a server.

Inheritance

Constructors

BoltClient({required BoltBinding binding, required Address server, Logger? logger})
A client for connecting to a server.

Properties

acknowledgedPackets Stream<Acknowledged<DataObject>>
Stream of packets that were acknowledged by the other end.
latefinalinherited
connectionState Stream<ConnectionState>
The current connection state of the client.
latefinal
currentConnectionState ConnectionState
The current connection state of the client.
no setter
hashCode int
The hash code for this object.
no setterinherited
id int?
The connection's unique identifier.
no setter
logger Logger
The logger to use.
finalinherited
packets Stream<Packet<DataObject>>
Stream of packets received from the other end.
latefinalinherited
protocolVersion int
The version of the protocol, this is used to determine if the client and server are compatible.
finalinherited
registry BoltRegistry
The registry that holds all the data objects serializers and payload types.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
server Address
The server address.
final

Methods

bind() Future<void>
Bind all the bindings.
inherited
connect(String token) Future<void>
Connects to the server.
disconnect() Future<void>
Disconnect and unbind all the bindings.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
off<T extends DataObject>(void callback(T message)) → void
Removes a callback for when a DataObject of type T is received.
offAck<T extends DataObject>(void callback(Acknowledged<T> data)) → void
Removes a callback for when an Acknowledged of a DataObject of type T is received.
on<T extends DataObject>(void callback(T data)) → void
Registers a callback for when a DataObject of type T is received.
onAck<T extends DataObject>(void callback(Acknowledged<T> data)) → void
Registers a callback for when an Acknowledged of a DataObject of type T is received.
onConnected() → void
Called when the client is connected to the server.
onDisconnected() → void
Called when the client is disconnected from the server.
rawSend<T extends DataObject, V extends DataResolver<T>>(T object, Address address, [int salt = 0]) → void
Send a DataObject packet to the address.
override
retrieveSalt(Address address) int
The salt to use for a packet sent to address.
override
send<T extends DataObject>(T data) → void
Sends data to the server.
toString() String
A string representation of this object.
inherited

Operators

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