Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 24, 2008, 4:00:00 PM (17 years ago)
Author:
scheusso
Message:

server is now able to deliver ping time and packet loss ratio for all its clients

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy/src/network/Server.cc

    r1953 r2009  
    163163    return connection->addPacket(packet, clientID);
    164164  }
    165 
     165 
     166  /**
     167   * @brief: returns ping time to client in milliseconds
     168   */
     169  unsigned int Server::getPing(unsigned int clientID){
     170    assert(ClientInformation::findClient(clientID));
     171    return ClientInformation::findClient(clientID)->getRTT();
     172  }
     173
     174  /**
     175   * @brief: return packet loss ratio to client (scales from 0 to 1)
     176   */
     177  double Server::getPacketLoss(unsigned int clientID){
     178    assert(ClientInformation::findClient(clientID));
     179    return ClientInformation::findClient(clientID)->getPacketLoss();
     180  }
     181 
    166182  /**
    167183  * processes all the packets waiting in the queue
Note: See TracChangeset for help on using the changeset viewer.