Jump to content

SharedVariable not working with HyperServer


Norm

Recommended Posts

I have a Standalone-Server application that uses a shared-variable in the ServerModule. Using the shared variable works as expected if I run the application without HyperServer. However if I run it through the HyperServer each session only sees its own changes to the shared variable and not the changes made by other sessions.The shared variable I am using is a simple counter (integer) that can be incremented by any session. After incrementing the counter within any session I can verify that it has been updated correctly. However other sessions do not see the increment.

I am using the CriticalSection lock mechanism as required. (FMSoft_uniGUI_Complete_Professional_1.90.0.1524).

Link to comment
Share on other sites

use txt file or db. If I'm not wrong, on hyperserver, each node is, restarted application diffrent port. So, node X and node Y is diffrent thread on OS. similiar application A application B.

when try get sessionlist, just can get, same node's session list

Link to comment
Share on other sites

...... from link below

Sessions

 

Another important difference from classical model is that in classical model your application is able to access all available session objects while in HyperServer each Node can only access sessions which are created by that specific Node. Needless to say that each Node holds a set of sessions which are isolated from other Nodes. If you need to query all of the sessions then you need to use different methods such as saving session information in a database table. You can simply create a row in the table when session is created and remove it when session is freed.

see this link more info:

http://unigui.com/doc/online_help/index.html?installing-and-configuring-hyp.htm

Link to comment
Share on other sites

On 3/21/2020 at 6:04 AM, qsslNorm said:

...However if I run it through the HyperServer each session only sees its own changes to the shared variable and not the changes made by other sessions.

Yes. With Hyperserver, nodes are totally isolated.

As Freeman suggested, I am using a DB field to store the shared variable. Then each new session load it on mainModule creat event.

That works fine.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...