- Timestamp:
- Nov 23, 2005, 2:49:39 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/connection_monitor.cc
r5720 r5726 31 31 32 32 /*Data of the lifetime of the ConnectionMonitor Object*/ 33 packetToAverage = 5;34 protocollType = "default ";33 packetToAverage = 100; 34 protocollType = "default(TCP)"; 35 35 36 36 startTime= SDL_GetTicks(); … … 68 68 void ConnectionMonitor::processPacket(byte* currentPacket, unsigned int packetLength) 69 69 { 70 /*Process the current Pack age*/70 /*Process the current Packet*/ 71 71 currentPacketTick = SDL_GetTicks(); 72 72 currentDelay = currentPacketTick - lastPacketTick; … … 86 86 sizeOfLastFewPackets += packetLength; 87 87 88 /* Do protocol related stuff89 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 102 88 /*Update the lifetime Variables*/ 103 89 totalReceivedPackets ++; … … 113 99 void ConnectionMonitor::computeCurrentDatarate() 114 100 { 115 int timeForLastFewPackets ;101 int timeForLastFewPackets=0; 116 102 for(int i=0;i < packetToAverage;i++) 117 103 timeForLastFewPackets += lastFewDelays[i]; … … 122 108 void doUDPRelatedStuff() 123 109 { 110 /* Do protocol related stuff 124 111 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 */ 125 122 } 126 123
Note: See TracChangeset
for help on using the changeset viewer.