Skip to main content
Participant
August 29, 2016
Question

Can server side AS defines shared variable between all instances?

  • August 29, 2016
  • 1 reply
  • 260 views

I want to create variable that share between all instances of application.

For example. I want to share number of connections.

rtmp://example.com/testApp/instanceA : 2 connections

rtmp://example.com/testApp/instanceB : 3 connections

=> 5 connections.

I tried to set property to "application" object in AS.

/opt/adobe/ams/applications/testApp/testApp.asc

application.onConnect = function(cli) {

  applicaion.counter += 1;

  trace(application.counter);

}

but "application" object is shared by same instance, isn't shared by application.

so testApp/instanceA output 2, and testApp/instanceB output 3.

# It's just example. I know that Administration API has getServerStats for count connections.

Thanks.

    This topic has been closed for replies.

    1 reply

    Adobe Employee
    September 27, 2016

    Did you go through SharedObjects documentation?

    Adobe Media Server Help | About shared objects