Initializes the socket.
The string WebSocket endpoint, ie, "ws://example.com/socket",
"wss://example.com"
"/socket" (inherited host & protocol)
Optional configuration
Initiates a new channel for the given topic
Parameters for the channel
Optionalparams: Record<string, any>The params to send when connecting, for example {user_id: userToken}
Passing params to connect is deprecated; pass them in the Socket constructor instead:
new Socket("/socket", {params: {user_id: userToken}}).
Disconnects the socket
See https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent#Status_codes for valid status codes.
Optionalcallback: () => voidCallback which is called after socket is disconnected.
Optionalcode: numberA status code for disconnection.
Optionalreason: stringA textual description of the reason to disconnect.
The fully qualified socket url
Returns the LongPoll transport reference
Returns true if a logger has been set on this socket.
Logs the message. Override this.logger for specialized logging. noops by default
Optionaldata: anyReturn the next message ref, accounting for overflows
Removes onOpen, onClose, onError, and onMessage registrations.
list of refs returned by calls to
onOpen, onClose, onError, and onMessage
Registers callbacks for connection close events
Registers callbacks for connection message events
Pings the server and invokes the callback with the RTT in milliseconds
Returns true if the ping was pushed or false if unable to be pushed.
Returns the socket protocol
Disconnects and replaces the active transport
The new transport class to instantiate
The Socket class.
For IE8 support use an ES5-shim (https://github.com/es-shims/es5-shim)