Methods
on(event, callback)
Listen for state change events.
Callback data
State values
Disconnect reasons
Whenstatus is "disconnected", the reason field may contain:
Reconnection behavior
- Reconnection window: 60 seconds from first disconnect
- Retry delay: 5 seconds between attempts
- If the window expires, state transitions to
"failed"with code4007
Next steps
Custom loading screen
Drive a loading screen from reconnection state changes.
Troubleshooting
Diagnose disconnect codes and reconnection failures.