WebSocketModule.OnClientDisconnectedAsync called twice when closing and reopening websocket #528
Labels
area:websockets
Issue with WebSocket protocol
bug
pinned
Pinned issues are not closed automatically when stale.
v3.x
Context
Hello,
I am doing some tests with websockets. I close an existing websocket and I open a new one just after:
I have an minimal WebsocketModule:
Observed Behaviour
The second time I re-open socket,
OnClientDisconnectedAsync
is called twice for the existing websocket that I juste closed.I get these log messages:
After tracing the code, It seems that
OnClientDisconnectedAsync
is called the first time fromPurgeDisconnectedContexts()
inOnRequestAsync()
and the second time from thefinally
block inOnRequestAsync()
.Enabling the watchdog or not does not change the behaviour
Expected Behavior
I expect that
OnClientDisconnectedAsync
is only called once per contextVersions
I observed the problem with EmbedIO v3.4.3 from nuget and build from source.
I tested with Firefox 89 and Chrome 91 on mac.
EmbedIO is called from the Unity Editor.
The text was updated successfully, but these errors were encountered: