Last change
on this file since 6275 was
5822,
checked in by bensch, 19 years ago
|
orxonox/trunk: merged branches/network to the trunk
merged with command:
svn merge -r 5505:HEAD branches/network trunk
conflicts resolved in favor of the trunk (as always
also fixed a typo in the #include "SDL_tread.h"
|
File size:
1.4 KB
|
Line | |
---|
1 | /*! |
---|
2 | * @file connection_monitor.h |
---|
3 | \brief provides information about the quality of a connection. |
---|
4 | */ |
---|
5 | |
---|
6 | #ifndef _CONNECTION_MONITOR_H |
---|
7 | #define _CONNECTION_MONITOR_H |
---|
8 | |
---|
9 | #include "base_object.h" |
---|
10 | #include "netdefs.h" |
---|
11 | |
---|
12 | class ConnectionMonitor : virtual public BaseObject |
---|
13 | { |
---|
14 | public: |
---|
15 | ConnectionMonitor(); |
---|
16 | ~ConnectionMonitor(); |
---|
17 | |
---|
18 | void processPacket(byte* packet, unsigned int packetLength); |
---|
19 | |
---|
20 | |
---|
21 | private: |
---|
22 | |
---|
23 | |
---|
24 | void displayStatistic(); |
---|
25 | void computeCurrentDatarate(); |
---|
26 | void doUDPRelatedStuff(); |
---|
27 | |
---|
28 | /*Data of the lifetime of the ConnectionMonitor Object*/ |
---|
29 | unsigned int packetToAverage; |
---|
30 | char* protocollType; |
---|
31 | |
---|
32 | unsigned int totalReceivedPackets; |
---|
33 | float averageDatarate; |
---|
34 | unsigned int totalLostPackets; |
---|
35 | float totalPacketloss; |
---|
36 | unsigned int startTime; |
---|
37 | |
---|
38 | /*Data of the current packet*/ |
---|
39 | unsigned int currentPacketID; |
---|
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; |
---|
47 | unsigned int currentDatarate; |
---|
48 | byte** lastFewPackets; |
---|
49 | unsigned int* lastFewDelays; |
---|
50 | unsigned int packetCounter; |
---|
51 | |
---|
52 | }; |
---|
53 | |
---|
54 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.