Protocol<T extends ProtocolChannel> class

Implementers

Constructors

Protocol({required T channel})

Properties

channel → T
final
closeKind → ProtocolCloseKind?
no setter
closeReason → String?
no setter
done → Future<Object?>
no setter
handlers → Map<String, ProtocolMessageHandler>
final
hashCode → int
The hash code for this object.
no setterinherited
isOpen → bool
no setter
recvMessageId ↔ int
getter/setter pair
recvPacketId ↔ int
getter/setter pair
recvPackets ↔ BytesBuilder
getter/setter pair
recvPacketTotal ↔ int
getter/setter pair
recvState ↔ String
getter/setter pair
recvType ↔ String
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
token → String?
no setter
url → Uri?
no setter

Methods

addHandler(String type, ProtocolMessageHandler handler) → void
close() → void
dispose() → void
getHandler(String type) → ProtocolMessageHandler?
getNextMessageId() → int
handleMessage(int messageId, String type, Uint8List data) → Future<void>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onDataReceived(Uint8List dataPacket) → void
removeHandler(String type, ProtocolMessageHandler handler) → void
send(String type, Uint8List data, {int? id}) → Future<void>
sendJson(Object object) → Future<void>
sendNowait(String type, Uint8List data, {int? id}) → int
start({ProtocolMessageHandler? onMessage, void onDone()?, void onError(Object? error)?}) → void
toString() → String
A string representation of this object.
inherited
waitForClose() → Future<void>

Operators

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

Static Methods

createFactory<T extends ProtocolChannel>({required T channel}) → ProtocolFactory