Socket Session
Represents a WebSocket session and provides methods for handling events and messages.
This class allows WebSocket clients to interact with the server, send/receive messages, and join/leave rooms.
Functions
Link copied to clipboard
Closes the WebSocket session with an optional reason.
Link copied to clipboard
Joins a specific room for the session.
Link copied to clipboard
Leaves the current room and reverts to the default "global" room.
Link copied to clipboard
Registers an event listener for a specific event.
Link copied to clipboard
Registers a wildcard event listener for all events.
Link copied to clipboard
Sets the callback function to be invoked when the WebSocket session is closed.
Link copied to clipboard
Sends a message to the WebSocket client.