Socket Registry
object SocketRegistry
A registry for managing WebSocket sessions.
This object maintains a collection of active WebSocket sessions and provides methods for sending messages, broadcasting to all sessions, or targeting specific sessions by user ID or room.
Functions
Link copied to clipboard
Adds a new WebSocket session to the registry.
Link copied to clipboard
Returns all active WebSocket sessions in the registry.
Link copied to clipboard
Broadcasts a message to all sessions in a room, excluding the sender's session.
Link copied to clipboard
Broadcasts a message to all sessions in a specific room.
Link copied to clipboard
Emits an event to a session identified by the username.
Link copied to clipboard
Removes a WebSocket session from the registry.