Web Socket Client
class WebSocketClient(apiKey: String, connect: PortalConnect, webSocketServer: String = "connect.portalhq.io")
WebSocketClient is responsible for managing a WebSocket connection to a remote server, handling events, and sending/receiving messages.
Constructors
Link copied to clipboard
constructor(apiKey: String, connect: PortalConnect, webSocketServer: String = "connect.portalhq.io")
Properties
Functions
Link copied to clipboard
Disconnects the WebSocket client, optionally specifying whether the disconnection was user-initiated.
Link copied to clipboard
Emits an event with the given name and associated data to registered handlers.
Link copied to clipboard
Registers an event handler for a specified event.
Link copied to clipboard
Sends a final message before disconnecting the WebSocket client.