NetTalk Central

Author Topic: see all loggin in users  (Read 2919 times)

olu

  • Sr. Member
  • ****
  • Posts: 352
    • View Profile
    • Email
see all loggin in users
« on: October 19, 2012, 12:14:15 PM »
Hi please can anyone help, i am trying to create a browse in my app so that when login, i can see all login users in other words who are online. please how can i do this?.

bshields

  • Sr. Member
  • ****
  • Posts: 392
    • View Profile
    • Inhabit
    • Email
Re: see all loggin in users
« Reply #1 on: October 19, 2012, 02:45:45 PM »
Hi

The NetWebServer object has a sessionqueue (not the data, but the actual sessions).

Its a queue for each netwebserver instance so treat it as global.

The NetWebServer object has its own critical section handling and you must use it.

You'll be in the NetWebServerWorker class when working on pages, so you'll need to access the NetWebServer object.

From within the worker class you can find it here:

self.RequestData.WebServer

So the idea would be:

self.RequestData.WebServer._wait()
LOOP i# = 1 TO RECORDS(self.RequestData.WebServer._sessionqueue)
  GET(self.RequestData.WebServer._sessionqueue,i#)
  !DO SOMETHING - but be damn quick about it
.
self.RequestData.WebServer._release()


You could either write the contents (well the bits you need) of the sessionqueue to a memoryfile or another globalqueue is you like critical sections, or generate some HTML (you'll need to be comfortable building your own pages via HTML for this one). Either way do it quick you are working on a critical section right in the middle of the server engine, so if you make a mistake its going to end badly.

IF you want to build a standard NetTalk browse for logged in users the MemoryFile is by far the easiest approach.

Regards
Bill
« Last Edit: October 19, 2012, 02:48:38 PM by bshields »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: see all loggin in users
« Reply #2 on: October 19, 2012, 11:06:14 PM »
Hi Olu,

>> Please can anyone help, i am trying to create a browse in my app so that when login, i can see all login users in other words who are online. please how can i do this?.

The process is straight-forward, but not completely trivial. May I ask the purpose you have in mind here? ie is it the _number_ of ligins you're interested in, or the whole list?

As far as writing the code goes, you may want to hang on until december before you go to any effort.

cheers
Bruce


Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 472
    • View Profile
    • Email
Re: see all loggin in users
« Reply #3 on: October 20, 2012, 11:55:22 AM »
Hallo Bruce,

>you may want to hang on until december before you go to any effort.
It will be a new future in NT7? or something regarding SecWin ?

Thank you,
Robert