RTC Forums

Subscription => Support => Topic started by: x3mike on February 15, 2013, 05:11:34 PM



Title: Connection lifetime based data
Post by: x3mike on February 15, 2013, 05:11:34 PM
Hello Danijel,

I need to hold some variabled during the lifetime of a connection. I had a look onto sessions, but the session cannot be closed, when the connection is closed.
Is there any other way to tell the server to release all of its modules used by a particular connection, when this connection is closed - maybe by killing the client?

Thank you,
Michael


Title: Re: Connection lifetime based data
Post by: D.Tkalcec (RTC) on February 15, 2013, 05:27:38 PM
Cleaning up Session data and calling Session.Close will close the Session. This works from any RTC event, including the OnDisconnect event. But if you do NOT want to use Sessions and want all user data to be removed immediately when the user closes its connection or loses the connection, you can also store your user data directly inside the "Info" property of the Sender:TRtcConnection component. That data will most definitely be lost when a connection is closed.

PS. Don't even mention "killing".

PPS. I'm not the only person monitoring these Forums, so you shouldn't start your questions with "Hello Danijel" ;)

Best Regards,
Danijel Tkalcec