PhoenixSocket class Null safety

Main class to use when wishing to establish a persistent connection with a Phoenix backend using WebSockets.

Constructors

PhoenixSocket(String endpoint, {PhoenixSocketOptions? socketOptions})
Creates an instance of PhoenixSocket [...]

Properties

channels Map<String, PhoenixChannel>
Map of topic names to PhoenixChannel instances being maintained and tracked by the socket.
read / write
closeStream Stream<PhoenixSocketCloseEvent>
Stream of PhoenixSocketCloseEvent being produced whenever the connection closes.
read-only
defaultTimeout Duration
Default duration for a connection timeout.
read-only
endpoint String
The string URL of the remote Phoenix server.
read-only
errorStream Stream<PhoenixSocketErrorEvent>
Stream of PhoenixSocketErrorEvent being produced in the lifetime of the PhoenixSocket.
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
isConnected bool
Whether the underlying socket is connected of not.
read-only
messageStream Stream<Message>
Stream of all Message instances received.
read-only
mountPoint Uri
The Uri containing all the parameters and options for the remote connection to occue.
read-only
nextRef String
A property yielding unique message reference ids, monotonically increasing.
read-only
openStream Stream<PhoenixSocketOpenEvent>
Stream of PhoenixSocketOpenEvent being produced whenever the connection is open.
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

addChannel({required String topic, Map<String, dynamic>? parameters, Duration? timeout}) PhoenixChannel
topic is the name of the channel you wish to join parameters are any options parameters you wish to send
close([int? code, String? reason, dynamic reconnect = false]) → void
Close the underlying connection supporting the socket.
connect() Future<PhoenixSocket?>
Attempts to make a WebSocket connection to the Phoenix backend. [...]
dispose() → void
Dispose of the socket. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
removeChannel(PhoenixChannel channel) → void
Stop managing and tracking a channel on this phoenix socket. [...]
sendMessage(Message message) Future<Message>
Send a channel on the socket. [...]
streamForTopic(String topic) Stream<Message>
A stream yielding Message instances for a given topic. [...]
toString() String
A string representation of this object. [...]
inherited
waitForMessage(Message message) Future<Message>
Wait for an expected message to arrive. [...]

Operators

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