Methods for multiple clients to be made aware of each other?

0
0

Hi there,

What is a suitable method for multiple clients to be aware of each other’s existence and activity, other than a database?

E.g.:

Let’s say a web app. needs to perform an activity, but this activity must only be run by ONE client.
So, on start-up, my web app. would need to check whether this activity is already being run by another client or not, and if not – run it, and if so – don’t run it (because it’s already being run).

How would the app. flag to other clients that the activity is being run?
How would each app. client check this flag?

The flag would obviously need to reside on the server, but my desktop-orientated brain can’t fathom how this is done with a web app.

Thank you

Regards,
Darren

  • You must to post comments
0
0

Hi Darren,

Any static variable is visible to all clients. Have a look at SimpleChat sample

 

  • Darren
    Hi Tiago, OK – that seems to work. I made a class and added a “Public Shared” variable within the class. This shared variable seems to be shared between all clients – which is what I wanted. Out of interest, I thought about using Application.Session.MyVariable – but couldn’t find any documentation on how to create your own Session variables? Thank you
  • Luca (ITG)
    Application.Session is not shared, it’s visible only by one client. https://wisej.com/docs/html/Session.htm It’s a dynamic object which is also a dictionary collection. You can create the variables on the fly just by assigning it. Or you can use Application.Session(“myVar”) = “value”. it’s the same as Application.Session.myVar = “value”.
  • Darren
    Thanks Luca.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.