SuperSocket
SuperSocket copied to clipboard
SendingQueues do not get released on duplicate SessionID (v1.6.x)
Hi,
I wanted to bring this up again since v2.0 is still in preview on NuGet and we've been using v1.6.6 for a few years now. There is a bug on the 1.6 branch - which also may have caused #100
If a client makes hundreds of connections, this error message appears sometimes:
The session is refused because the it's ID already exists!
which is ok, the session does not get processed further.
But.. at this point there is already a SendingQueue reserved for this session and it does not get released again.
That works until all sending queues get reserved and then this error appears:
There is no enougth sending queue can be used
and the server stops responding.
I fixed it by changing
if (!AppServer.RegisterSession(appSession))
return null;
to
if (!AppServer.RegisterSession(appSession))
{
socketSession.Close(CloseReason.ServerClosing);
return null;
}
It might not be the right way to solve this, but I hope it points you to the right direction.
Kind regards and keep up the great work! Stefan
Good catch:
I just did a fix. Thank you!
https://github.com/kerryjiang/SuperSocket/commit/831910a8c5a5e8e94a22ecc7ba595855fe0c9331
Good catch:
I just did a fix. Thank you!
I have the same problem. Will this version be updated on nuget?
No, could you build from the source code by yourself?