Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/network/src/lib/network/connection_monitor.h @ 5618

Last change on this file since 5618 was 5618, checked in by snellen, 18 years ago

connection_monitor.cc and connection_monitor.h updated

File size: 1.3 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
12class 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                computeAverageStatistic();
26
27    /*Data of the lifetime of the ConnectionMonitor Object*/
28    unsigned int        packetToAverage;
29
30    unsigned int        totalReceivedPackets;
31    float               averageDatarate;
32    unsigned int        totalLostPackets;
33    float               totalPacketloss;
34    unsigned int        startTime;
35
36    /*Data of the current packet*/
37    unsigned int        currentPacketID;
38    unsigned int        currentPacketTick;
39    unsigned int        lastPacketID;
40    unsigned int        lastPacketTick;
41    unsigned int        currentDelay;
42
43    /*Data of the last n packets (n is specified by paxketsToAverage)*/
44    unsigned int        sizeOfLastFewPackets;
45    unsigned int        currentDatarate;
46    byte**              lastFewPackets;
47    unsigned int*       lastFewDelays;
48    unsigned int        packetCounter;
49
50  };
51
52#endif
Note: See TracBrowser for help on using the repository browser.