A property to determine if the current socket implementation is actually connected with the remote endpoint or not. If the Socket is actually connected, consumer can assume messages can be sent through the WebSocket.
Perform an actual connection with the remote WebSocket endoint. This
will usually construct a WebSocket
instance and initiate the
connection with the remote endpoint.
The method receives a listener which will receive all messages sent through the WebSocket by the remote endpoint.
The actual callback that will receive all the messages sent by the remote endpoint through the WebSocket.
The options that can be passed to the connect method for certain functionalities.
Disconnects the actual socket. This closes the underlying socket by closing it and clean up all resources.
Send a message through the WebSocket. The message is stringified to JSON before being sent to the remote endpoint
The actual message to send to the remote endpoint.
Assigns a new API token to the stream client instance meaning the previous one is not good anymore.
This usualy indicates the previous token is not valid anymore. This does not re-trigger a re-connection automatically.
Instead, it should change the internal state of the Socket instance, and once a re-connection is requested (by the client or by the server), the new API token should be used to re-construct the WebSocket url to contact.
The new API token that should be now set as the active token
Generated using TypeDoc
An abstraction over a WebSocket object to deal more easily with the WebSocket protocol.
This interface will usually abstract connection/disconnection as well as dealing with re-connection and disconnection error and handling all events of the WebSocket API (baseline is the W3C WebSocket API).
Interfaces