Connection class

Provides Pusher protocol interface for transports. Emits following events:

  • message - on received messages
  • ping - on ping requests
  • pong - on pong responses
  • error - when the transport emits an error
  • closed - after closing the transport It also emits more events when connection closes with a code. See Protocol.getCloseAction to get more details.
Inheritance
Implemented types
Annotations
  • @JS()

Constructors

Connection(String id, TransportConnection transport)
factory

Properties

activityTimeout num
getter/setter pair
callbacks CallbackRegistry
getter/setter pairinherited
failThrough Function
getter/setter pairinherited
global_callbacks List<Function>
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
id String
getter/setter pair
onactivity Function?
getter/setter pairoverride
onclose ↔ dynamic Function(dynamic)?
getter/setter pairoverride
onerror ↔ dynamic Function(dynamic)?
getter/setter pairoverride
onmessage ↔ dynamic Function(dynamic)?
getter/setter pairoverride
onopen ↔ dynamic Function([dynamic evt])?
getter/setter pairoverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
transport TransportConnection
getter/setter pair

Methods

bind(String eventName, Function callback, [dynamic context]) → dynamic
inherited
bind_global(Function callback) → dynamic
inherited
bindListeners() → dynamic
close([dynamic code, dynamic reason]) → void
Closes the connection.
override
emit(String eventName, [dynamic data, Metadata metadata]) Dispatcher
inherited
handleCloseEvent(dynamic closeEvent) → dynamic
handlesActivityChecks() → dynamic
Returns whether used transport handles activity checks by itself
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
ping() → void
Sends a ping message to the server. Basing on the underlying transport, it might send either transport's protocol-specific ping or pusher:ping event.
override
send(dynamic data) bool
Sends raw data.
override
send_event(String name, dynamic data, [String channel]) bool
Sends an event.
sendRaw(dynamic payload) bool
override
toString() String
A string representation of this object.
inherited
unbind([String eventName, Function callback, dynamic context]) → dynamic
inherited
unbind_all() → dynamic
inherited
unbind_global([Function callback]) → dynamic
inherited

Operators

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