leaks in the AsyncSocketServer ::m_MaxConnectionSemaphore???

Aug 29, 2012 at 12:49 PM

That semaphore controls the number of clients that can connect to the server and my question is about the m_MaxConnectionSemaphore.Release()  which is called only in session_Closed.

In the AceptNewClient method, you try to register a session and if it fails, then you call Async.Run(() => client.SafeCloseClientSocket(AppServer.Logger)) and returns, and so the Release is never called.

That means that in the case of n failures, the semaphore value will just decrease of n and when reaching 0, no more connection will be accepted as the listener thread will be blocked on m_MaxConnectionSemaphore.WaitOne.


Aug 29, 2012 at 2:01 PM

Great! You help me find a bug in SuperSocket 1.4, which will cause problems when connection filer is used.

I'll commit a fix moments later. 

Aug 29, 2012 at 2:13 PM

Super:-) I continue to read your code as there are wonderful things to learn about nice c# features.

And after supersocket, I continue with superWebsocket :-)

Aug 29, 2012 at 2:15 PM

Any suggestions are welcome, you also can share with me your feeling.

Aug 29, 2012 at 2:32 PM

Great, for the moment my feeling is very very positive and one solid proof of the fllexibility of your framework
is the nice way you implemented the websocket protocol on it (Yup, I already delve a little into  your superWebSocket 

Ok, now go back to the code :-)

Aug 29, 2012 at 3:21 PM

Of course, the same m_MaxConnectionSemaphore.Release()  issue occurs in SyncSocketServer<TAppSession, TCommandInfo>::StartListen() :-)

Aug 30, 2012 at 10:18 AM

Great, thank you very much!

Aug 30, 2012 at 11:54 AM

U are welcome :-)