source:
orxonox.OLD/trunk/src/lib/network/connection_monitor.h
@
6026
Last change on this file since 6026 was 5822, checked in by bensch, 19 years ago | |
---|---|
File size: 1.4 KB |
Rev | Line | |
---|---|---|
[5523] | 1 | /*! |
2 | * @file connection_monitor.h | |
3 | \brief provides information about the quality of a connection. | |
[5550] | 4 | */ |
[5523] | 5 | |
[5550] | 6 | #ifndef _CONNECTION_MONITOR_H |
7 | #define _CONNECTION_MONITOR_H | |
[5523] | 8 | |
[5581] | 9 | #include "base_object.h" |
[5550] | 10 | #include "netdefs.h" |
[5547] | 11 | |
[5581] | 12 | class ConnectionMonitor : virtual public BaseObject |
[5618] | 13 | { |
14 | public: | |
15 | ConnectionMonitor(); | |
16 | ~ConnectionMonitor(); | |
[5523] | 17 | |
[5618] | 18 | void processPacket(byte* packet, unsigned int packetLength); |
[5581] | 19 | |
20 | ||
[5618] | 21 | private: |
[5523] | 22 | |
[5581] | 23 | |
[5550] | 24 | void displayStatistic(); |
[5720] | 25 | void computeCurrentDatarate(); |
26 | void doUDPRelatedStuff(); | |
[5547] | 27 | |
[5618] | 28 | /*Data of the lifetime of the ConnectionMonitor Object*/ |
29 | unsigned int packetToAverage; | |
[5720] | 30 | char* protocollType; |
[5618] | 31 | |
[5550] | 32 | unsigned int totalReceivedPackets; |
[5618] | 33 | float averageDatarate; |
[5550] | 34 | unsigned int totalLostPackets; |
[5618] | 35 | float totalPacketloss; |
36 | unsigned int startTime; | |
[5550] | 37 | |
[5618] | 38 | /*Data of the current packet*/ |
[5581] | 39 | unsigned int currentPacketID; |
[5618] | 40 | unsigned int currentPacketTick; |
41 | unsigned int lastPacketID; | |
42 | unsigned int lastPacketTick; | |
43 | unsigned int currentDelay; | |
44 | ||
45 | /*Data of the last n packets (n is specified by paxketsToAverage)*/ | |
46 | unsigned int sizeOfLastFewPackets; | |
[5550] | 47 | unsigned int currentDatarate; |
[5618] | 48 | byte** lastFewPackets; |
49 | unsigned int* lastFewDelays; | |
50 | unsigned int packetCounter; | |
[5550] | 51 | |
[5618] | 52 | }; |
[5550] | 53 | |
54 | #endif |
Note: See TracBrowser
for help on using the repository browser.