PhoenixSocket class

Constructors

PhoenixSocket(String endpoint, {dynamic socketOptions = PhoenixSocketOptions, dynamic connectionProvider = PhoenixConnectionProvider})
Creates an instance of PhoenixSocket

Properties

channels List<PhoenixChannel>
getter/setter pair
conn → PhoenixConnection?
no setter
connectionState int
no setter
endpoint Uri?
no setter
hashCode int
The hash code for this object.
no setterinherited
isConnected bool
no setter
reconnectAfterMs List<int>
getter/setter pair
ref int
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sendBufferLength int
no setter
timeout int
getter/setter pair

Methods

channel(String topic, [Map params = const {}]) PhoenixChannel
topic is the name of the channel you wish to join params are any options parameters you wish to send
connect() → dynamic
Attempts to make a WebSocket connection to your backend
disconnect({int code = PhoenixConnection.CLOSE_NORMAL}) → dynamic
Terminates the socket connection with an optional code
makeRef() String
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onClose(dynamic callback(dynamic)) → dynamic
Add a callback to be executed when the connection is closed
onError(dynamic callback(dynamic)) → dynamic
Add a callback to be executed if an error occurs
onMessage(dynamic callback(PhoenixMessage)) → dynamic
Add a callback for when a message is received
onOpen(dynamic callback()) → dynamic
Add a callback to be executed when the connection is successfully made
push(PhoenixMessage msg) → void
Pushes a message to the server
reconnect() → dynamic
In the event of a network dropout or other error, attempt to reconnect
remove(PhoenixChannel channelToRemove) → dynamic
stopHeartbeat() → void
toString() String
A string representation of this object.
inherited

Operators

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