Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 23, 2005, 2:49:39 PM (18 years ago)
Author:
snellen
Message:

connection monitor updated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/network/connection_monitor.cc

    r5720 r5726  
    3131
    3232  /*Data of the lifetime of the ConnectionMonitor Object*/
    33   packetToAverage = 5;
    34   protocollType = "default";
     33  packetToAverage = 100;
     34  protocollType = "default(TCP)";
    3535
    3636  startTime= SDL_GetTicks();
     
    6868void ConnectionMonitor::processPacket(byte* currentPacket, unsigned int packetLength)
    6969{
    70   /*Process the current Package*/
     70  /*Process the current Packet*/
    7171  currentPacketTick = SDL_GetTicks();
    7272  currentDelay = currentPacketTick - lastPacketTick;
     
    8686  sizeOfLastFewPackets += packetLength;
    8787
    88   /*  Do protocol related stuff
    89 
    90   Only for Udp:
    91   "currentPacketID = getID from package";
    92 
    93   if(currentPacketID - lastPacketID > 1)
    94   {
    95   totalLostPackets += currentPacketID - lastPacketID;
    96 }
    97 
    98   totalPacketloss = (totalLostPackets/totalReceivedPackets)*100 ;
    99   */
    100 
    101 
    10288  /*Update the lifetime Variables*/
    10389  totalReceivedPackets ++;
     
    11399void ConnectionMonitor::computeCurrentDatarate()
    114100{
    115   int timeForLastFewPackets;
     101  int timeForLastFewPackets=0;
    116102  for(int i=0;i < packetToAverage;i++)
    117103    timeForLastFewPackets += lastFewDelays[i];
     
    122108void doUDPRelatedStuff()
    123109{
     110  /*  Do protocol related stuff
    124111
     112  Only for Udp:
     113  "currentPacketID = getID from package";
     114
     115  if(currentPacketID - lastPacketID > 1)
     116  {
     117  totalLostPackets += currentPacketID - lastPacketID;
     118}
     119
     120  totalPacketloss = (totalLostPackets/totalReceivedPackets)*100 ;
     121  */
    125122}
    126123
Note: See TracChangeset for help on using the changeset viewer.