application.clients[client.id].call - not working??...


i need wey without knowing index value of spacific client in application clients array

to identify user use:

application.clients[this client id].call

to him only.

 

in addobe halp says:

"do not use index value of clients array identify users between calls, because array compacted when users disconnect , slots reused other client objects"

 

but not use??...

 

i try 4 ways none working - last 2 throw error:

application.onconnect = function(client)
{

     application.userid = client.id;

 

     application.clients[application.userid].call("serverdodisconect");

     application.clients["" + application.userid + ""].call("serverdodisconect");
     application[application.userid].call("serverdodisconect");
     application.userid.call("serverdodisconect");

}

 

at moment use not solution:

application.onconnect = function(client)
{

     client.name = "user";

 

     (i = 1; < application.clients.length; i++)
     {
         if(application.clients[i].name == "user")
         {
          application.clients[i].call("serverdodisconect");
         }
    }

}

 

please halp

thanks

cheinan

hi,

 

the below code works me.

 

server side code :

var nc = new netconnection;
application.onconnect = function(client) {
      application.acceptconnection(client);
      application.clients[client.id].call("serverdodisconect");
}

 

client side code :

nc = new netconnection();
nc.onstatus = function(info){
      trace(info.code);
}
nc.connect("rtmp://localhost/test");
nc.serverdodisconect = function(){
      trace("serverdodisconect...");
}

 

please note when clientobject.call method "serverdodisconect" called on client's netconnection object.

so needed declared on client above.

 

regards,

amit



More discussions in Adobe Media Server


adobe

Comments

Popular posts from this blog

Joomla site hacked, cant see front and - Joomla! Forum - community, help and support

Christian Home School Programs - Joomla! Forum - community, help and support

Trouble with PF_OutFlag_I_USE_AUDIO and PF_CHECKOUT_LAYER_AUDIO