Server side#
The following events are fired by default on the server side:
- connection#
Fired when a client connects to the server.
Returns:
client_id: The new client’s socket UUID.
- disconnect#
Fired when a client disconnects from the server.
Returns:
client_id: The client’s socket UUID.
- message#
Fired when a client emits an event to the server.
Returns a
tupleof:event: The name of the emitted event.data: The data emitted by the client.
- error#
Fired when an uncaught exception occurs in the server. If you don’t handle this event, the server will raise the exception.
Returns:
error: The exception message.