Fetch required sessions from AppServer
AppServer includes an efficient session container, which allows you to get you required sessions and then communicate with them.
Get the specified session by SessionKey
var session = appServer.GetAppSessionByIndentityKey(sessionKey);
if (session! = null)
session.SendResponse ("Hello world!");
This way can find a session by session key real-time.
Get all connected sessions
var sessions = appServer.GetAllSessions();
foreach(var s in sessions)
{
session.SendResponse("Hello world!");
}
In this way, all sessions come from a session snapshot. So all the sessions may be stored in snapshot some seconds/minutes ago.
Please check the
Basic Configuration documentation for more details of session snapshot.
Get matched sessions by criteria
var sessions = appServer.GetSessions(s => s.CompanyId == companyId);
foreach(var s in sessions)
{
session.SendResponse(data);
}
In this way, all sessions come from a session snapshot. So all the sessions may be stored in snapshot some seconds/minutes ago.
Please check the
Basic Configuration documentation for more details of session snapshot.