Too high ping
Hi,
I'm building a chat app and there are between 100 and 900 users inside. I'm checking if a user is connected to the FMS by pinging it and if the stats['ping_rtt'] is higher that 3 secs i disconnect the user. The problem is that some user are connected but have very high ping like 30 secs or even higher. Does anyone have an idea what can be the reason for the high ping?
This is how i check if the user is alive
/*
* check if the user is alive
*/
Client.prototype.isAlive = function() {
if (this.ping()) {
var stats = this.getStats();
var timeout_value = 16 * 1000; // ms.
if (stats)
{
return (stats['ping_rtt'] < timeout_value);
}
}
else
{
return false;
}
return true;
}
