RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomSessionsService.Clear Method

Deletes all sessions from memory.

Pascal
procedure Clear;
C++
__fastcall Clear();

Call Clear to empty the sessions service of all the sessions it has stored in memory. 

Clear does not generate an OnEndSession event for the sessions it deletes when it frees their memory, it simply removes them from memory. To shut down all sessions in a more orderly fashion, iterate through all the active sessions by calling ConnectActive for every session ID that the GetSessionIDs method returns, and terminate each one. Then call NotifyStatusChange to generate the OnEndSession events for every terminated session. At that point, calling Clear does not prevent the application from receiving an OnEndSession event for any session that the sessions service manages. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!