Create a WebSocketReliable object, and open it if an url is passed in argument
Optional url: string | URLURL of the WebSocket endpoint or null to start the connection later
Optional protocols: string | string[]Private _closedPrivate _openedPrivate _queueingPrivate _queueingPrivate _recvPrivate _sendPrivate _sendPrivate Optional _wsStart a log
a Log object with the levels of log to call
binaryType, fix binary type to arrayBuffer
The number of bytes of data that were queued during calls to send() but not yet transmitted to the network
True when connection is closed, in other words when onClose event is fired or when WebSocketReliable is build without url (disconnected creation)
extensions negociated by the server
opened equals true when connection is etablished, in other word when onOpen event is fired
protocol negociated by the server
Queued messages from a call to send() waiting to be transmit one time websocket connection opened (or with an explicit call to flush() method)
url of connection
Close websocket
Optional error: WebSocketReliableErrorthe error reason if is not a proper close
Event subscription
Name of event without the on prefix (ex: log to onLog event declared)
Subscriber Function
Optional options: { Optional signal?: AbortSignalOptional AbortSignal to stop this or multiple subscriptions in same time
Event subscription only one time, once time fired it's automatically unsubscribe
Name of event without the on prefix (ex: log to onLog event declared)
Subscriber Function
Optional options: { Optional signal?: AbortSignalOptional AbortSignal to stop this or multiple subscriptions in same time
Open a WebSocket connection
url of the websocket endpoint
Optional protocols: string | string[]this
Send a message
Optional queueing: booleanWhen set it reports the sending to a more later call to flush
this
Fired on websocket close
Optional error: WebSocketReliableErrorerror description on an improper closure
Generated using TypeDoc
The WebSocketReliable class extends WebSocket to bring up the following improvements:
Example