Client class

Main Faye client for Bayeux protocol communication

Constructors

Client(String endpoint, [Map<String, dynamic>? options])

Properties

advice → Map<String, dynamic>
Get connection advice
no setter
clientId → String?
Get client ID
no setter
errorStream → Stream<FayeError>
Get error stream
no setter
hashCode → int
The hash code for this object.
no setterinherited
messageStream → Stream<Map<String, dynamic>>
Get message stream
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
state → int
Get current state
no setter
stateStream → Stream<int>
Get state change stream
no setter
statistics → Map<String, dynamic>
Get client statistics
no setter
subscriptions → List<Subscription>
Get all subscriptions
no setter
transport → String?
Get current transport
no setter

Methods

addWebSocketExtension(dynamic extension) → void
Add WebSocket extension
close() → Future<void>
Close the client
connect({Map<String, String>? headers}) → Future<void>
Connect to the server
disable(String feature) → void
Disable a feature
disconnect() → Future<void>
Disconnect from the server
extractBayeuxMessage(dynamic response) → Map<String, dynamic>
Extract the first message from a Bayeux response Bayeux responses can be either a single object or an array of objects
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
publish(String channel, dynamic data) → Future<Publication>
Publish a message to a channel
setExtension(dynamic extension) → void
Set extension for message processing
setHeader(String name, String value) → void
Set HTTP header
setTransport(String transportName) → void
Set transport
subscribe(String channel, SubscriptionCallback callback) → Future<Subscription>
Subscribe to a channel
toString() → String
A string representation of this object.
override
unsubscribe(String channel) → Future<void>
Unsubscribe from a channel
unsubscribeSubscription(Subscription subscription) → Future<void>
Unsubscribe using subscription object

Operators

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

Constants

connected → const int
connecting → const int
connectionTimeout → const int
Connection timeout in seconds
defaultEndpoint → const String
Default endpoint
defaultInterval → const int
Default interval
disconnected → const int
handshake → const String
Reconnection advice constants
none → const String
retry → const String
unconnected → const int
Client state constants