This project is read-only.

New Session creation delay


I have following issue, need to know if its a bug?
When my app connects to the server and sends SESSIONCOUNT as a first command server replies with number of current sessions. But sometimes the result is 0 - sessions. Looks like there is a delay between session addition to SessionSource and socket initialization, because socket was able to receive and send data back, but session is not in the SessionSource collection yet. Is this a bug?

public override void ExecuteCommand(RemoteProcessSession session, StringCommandInfo commandInfo)
        session.SendResponse(commandInfo.Data + " - {0}", session.AppServer.GetAllSessions().Count());


kerryjiang wrote Oct 13, 2011 at 2:22 AM

Yes, it is by design.
The sessions of method GetAllSessions() come from session snapshot which cannot update realtime.
I think you can use appServer.SessionCount instead.