RTC Forums
May 07, 2024, 01:54:26 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Session list  (Read 3570 times)
HelgeLange
RTC Expired
*
Posts: 100


« on: May 03, 2017, 12:30:15 AM »

Hi Danijel,

short question : is there a session list the server module that I can search through and access the information. I know that I can access the session when a request comes in, but I'd like to access the session list and some information when I need it in the server process.

Thanks, Helge
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #1 on: May 03, 2017, 05:01:38 AM »

Short answer: There are no methods or functions which would give you access to a list of Sessions.

Long answer: Even though you can check if a Session exists (if you know the Session ID) by using the HaveSession method and lock the Session for read/write access using the FindSession method (both accessible from any TRtcDataServer component descendant), you should ONLY use the FindSession method from events triggered by the Client owning the Session.

When a Session is locked for access, the Session object is moved from the internal Session list to the TRtcDataServer descendant component (where the FindSession method was called) and can NOT be accessed from any other place (FindSession would return FALSE, while HaveSession returns TRUE) until the Session is unlocked again.

If you need to access some user data from other threads (not by Clients owning each Session), you should store that data in a separate data structure (your own objects).

Best Regards,
Danijel Tkalcec
Logged
HelgeLange
RTC Expired
*
Posts: 100


« Reply #2 on: May 03, 2017, 03:05:52 PM »

OK, thanks... Not what I wanted to hear, but it is what it is Smiley
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.023 seconds with 17 queries.