Aug 28, 2013 at 10:30 AM
Edited Aug 28, 2013 at 10:50 AM
Is there a way I can freely manage the socket sessions created by an AppServer externally?
I'm fooling around with AppSessions because I want to be able to access the TrySend and Send method of a session wherever in a system (i.e. even if I'm not within the context of a ServerCommand).
While fiddling with ServerCommands (Commands that implement CommandBase), I saw that the AppServer instance found in them has a method that goes something like
from where I can access (and hopefully manage through memory) the sessions on my own.
Knowing that, I attempted to access the list of AppSessions through my AppServer right after the bootloader kicks in. So I made a class that will manages AppServers and register them immediately after the bootloader, and from that manager I though I could access
Unfortunately though, I found out that the AppServer type returned by the bootloader is way different than the one I found in my implementation of a CommandBase. Seems like the ones in the bootloader contained only AppServer summaries, not the AppServer itself.
As a workaround, I made my own AppSession manager class that registers an AppSession during a particular ServerCommand.
While the concept of registering and accessing the session works, I am now stumped as of how do I remove an AppSession properly from my manager whenever the AppServer has closed it down after idling for too long (I use these attributes to close idle sessions:
clearIdleSession="true" idleSessionTimeOut="300" clearIdleSessionInterval="120"
I can't think of a way to send a signal from an AppServer when it closes down an AppSession. Something that would enable me to go
"Hey the AppServer said it's closing down this session, remove it from your session manager."
- Is there a more proper way to manage AppSessions than what I've already implemented?
- How can I access the AppSessions right after the bootloader loads? Such as I can already manipulate the AppSessions through memory with the use of an AppSession manager class in a different DLL?