Skip to main content
Participant
February 16, 2011
Question

Too high ping

  • February 16, 2011
  • 1 reply
  • 503 views

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;
}
    This topic has been closed for replies.

    1 reply

    Participating Frequently
    February 17, 2011

    It could be because of network latencies. You can also check if you  have sufficient bandwith between the user and the server with methods  like client.checkBandwidth() on the server side.