kerryjiang / SuperWebSocket

SuperWebSocket is a .NET implementation of WebSocket server.
Apache License 2.0
504 stars 194 forks source link

Connection established but GetAllSessions finds nothing until a little time has passed. #31

Closed vspin closed 8 years ago

vspin commented 8 years ago

Note that I am Starting By Config (if that matters).

I have been building my app, and I noticed that after a client connects to the server, and then sends a message immediately after, the ExecuteJsonCommand fires, however, GetAllSessions/GetSessions produced zero results until a small period of time has elapsed (less than 2 seconds).

From the samples, I added the following code, and it too revealed zero connections after a connection was established..

void webSocketNewSessionConnected (WebSocketSession session) { int x = 0; foreach (var s in GetAllSessions()) { x++; } Console.WriteLine ("foreach count: {0} SessionCount: {1}", x, SessionCount); //outputs: foreach count: 0 SessionCount: 1 }

I hope I'm missing something because that is a big issue for me.

vspin commented 8 years ago

disableSessionSnapshot="true"