Wrong disconnection events order for clients
wikiti opened this issue · comments
When a client closes his session, the following events are being fired:
- NETWORK_EVENT_CLOSED
- NETWORK_EVENT_DISCONNECTED
They should be fired in the following order:
- NETWORK_EVENT_DISCONNECTED
- NETWORK_EVENT_CLOSED
Actually, the behaviour is working as expected:
NETWORK_EVENT_CLOSED
will be fired after the the session is closed manually, by calling astop()
method.NETWORK_EVENT_DISCONNECTED
will be fired after the client's socket has been closed, which will be done asynchronosly.- The chances that
NETWORK_EVENT_CLOSED
being fired beforeNETWORK_EVENT_DISCONNECTED
are pretty high. However, this should not be problematic.
The documentation (README.md
) should be updated before closing this issue.