Title: OnSessionClose Event Post by: HelgeLange on May 31, 2015, 05:23:25 PM Hi Danijel,
I'm implementing sessions atm. and I wonder if there is a way to know, which session is gone in the OnSessionClose event. The variables I had saved there are gone. The workaround I'm writing now is the use of a TRtcObject sabed in the Session.Obj['MyObj'] property, that should get killed when the session closes and I get to throw an event with the data I need to clean up my stuff (like notifying the monitor app which client has disconnected through other ways than Logout, i.e. Timeout) So any way to make it easier ? Thanks in advance... Helge Lange Title: Re: OnSessionClose Event Post by: D.Tkalcec (RTC) on May 31, 2015, 06:02:23 PM The Session being closed will be accessible through the TRtcDataServer(Sender).Session variable in the OnSessionClose event.
Best Regards, Danijel Tkalcec Title: Re: OnSessionClose Event Post by: HelgeLange on May 31, 2015, 09:08:53 PM I know :)
But the variable inside isn't there anymore :) So If I call logout (A remote function), I can access the TRtcDataServer(Sender).Session.asInteger['MyId'] and I get let's say 30 In the OnSessionClose event I get 0 I checked both with debugger and CodeSite Title: Re: OnSessionClose Event Post by: D.Tkalcec (RTC) on June 01, 2015, 12:43:05 AM If the data is no longer in the Session variable, then you must have cleared it already (or it is not the Session you were expecting), because RTC does NOT make any changes to Session data. RTC will ONLY destroy the Session object (along with any data stored inside) after the OnSessionClose event.
Best Regards, Danijel Tkalcec |