Macromedia Flash Server - the application sometime don't disconnect: a solution...

This is Interesting: Free IT Magazines  
Home > Archive > Macromedia Flash Server > July 2005 > the application sometime don't disconnect: a solution...





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author the application sometime don't disconnect: a solution...
Alfonso Florio

2005-07-30, 7:45 am

Here's my solution to solve the problem of connections that remains alive
after disconnection...

I've noticed that just pinging is useless, cause pinging this infamous
computer that don't disconnects i receive always a true!!!!!

The situation is strange, and it's determined by the computer itself, not
by the network where is connected.
Other computers on that networks close well, and that computers don't close
also connected with other ISPs.

Anyway here's my code, I would appreciate if anybody can suggest if there
is something wrong or any optimization on it...



ON THE CLIENT:

nc.stillAlive = function() {
return ("hello");
};

SSAS:

lifeHandler = function(clientID,clientOBJ){
this.onResult = function(res){
if(res != "hello") {
application.disconnect(clientOBJ);
}
}
this.onStatus = function(info){
application.disconnect(clientOBJ);
trace("failed and got:" + info.code);
}
};

function pingalo() {
for(i=0;i<application.clients.length;i++) {
application.clients[i].call("stillAlive", new
lifeHandler(application.clients[i].name,application.clients[i]));
}
}



application.onConnect = function(client, name){

application.intervallo=setInterval(pingalo,5000);
}


application.onAppStop = function (info){
clearInterval(application.intervallo);
};


=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com