You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the transport upgrades from XHR to WebSocket, all existing close events get cleared out. I am not sure if this is intended behavior, and I am currently working around it by reattaching close events upon receiving an upgrade event.
Repro
wait for "connection" event for EngineIOSocket.
Attach "close" event immediately on EngineIOSocket
Wait for EngineIOSocket client transport to upgrade. Should happen more or less immediately if websocket transport is configured.
Close browser or java engine io client
Observe that the "close" originally attached close event is not fired. It is not even in the internal callback list, because it was cleared during upgrade.
The text was updated successfully, but these errors were encountered:
That is by design. The callbacks for the old transport is cleared and new ones are registered by callingsetTransport.
I'll take a better look at it when I get the time.
Yes, this seems to work fine. Great work on the library btw. I managed to port this to Android in day, onto a custom http+websocket server stack, with zero changes. This was the only bug I encountered.
See here:
https://github.com/socketio/engine.io-server-java/blob/master/engine.io-server/src/main/java/io/socket/engineio/server/EngineIoSocket.java#L135
When the transport upgrades from XHR to WebSocket, all existing close events get cleared out. I am not sure if this is intended behavior, and I am currently working around it by reattaching close events upon receiving an upgrade event.
Repro
The text was updated successfully, but these errors were encountered: