Built-in Events
connect
Emitted when connection established.disconnect
Emitted when connection lost.connect_error
Emitted on connection failure.error
Emitted on socket errors.Custom Events
Define custom events for application logic.Server Side
Client Side
Event Naming
Best practices:- Use kebab-case:
'user-joined' - Be descriptive:
'message-received' - Namespace if needed:
'chat:message'