WebSocketTransport class

WebSocket transport implementation for Bayeux protocol

Inheritance

Constructors

WebSocketTransport()
Constructor

Properties

connected → bool
Whether this transport is currently connected
no setterinherited
connectionStateStream → Stream<bool>
Stream of connection state changes
no setterinherited
errorStream → Stream<FayeError>
Stream of errors
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
messageStream → Stream<Map<String, dynamic>>
Stream of messages received from the transport
no setterinherited
name → String
Transport name
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
statistics → Map<String, dynamic>
Get transport statistics
no setteroverride
supported → bool
Whether this transport is supported (always true for WebSocket)
no setteroverride
timeout ↔ int
Connection timeout in seconds
getter/setter pairinherited

Methods

close() → Future<void>
Close the transport
override
connect(String url, {Map<String, String>? headers}) → Future<void>
Connect to the server
override
disconnect() → Future<void>
Disconnect from the server
override
emitError(FayeError error) → void
Emit an error
inherited
emitMessage(Map<String, dynamic> message) → void
Emit a message
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
recordConnectTime(int milliseconds) → void
Record connection time
inherited
recordMessageSent(Map<String, dynamic> message) → void
Record message sent
inherited
send(Map<String, dynamic> message) → Future<void>
Send a message to the server
override
sendBatch(List<Map<String, dynamic>> messages) → Future<void>
Send multiple messages to the server
override
setAutoReconnect(bool enabled, {int maxAttempts = 5, int delay = 1000}) → void
Set auto-reconnect settings
setProtocols(List<String> protocols) → void
Set WebSocket protocols
toString() → String
A string representation of this object.
inherited
updateConnectionState(bool connected) → void
Update connection state
inherited
updateLastActivity() → void
Update last activity timestamp
inherited

Operators

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