-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathTTFSession.h
More file actions
34 lines (27 loc) · 752 Bytes
/
TTFSession.h
File metadata and controls
34 lines (27 loc) · 752 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once
#include <sys/time.h>
#include <string>
#include <tr1/memory>
class TTFSession
{
public:
const unsigned int localAddr;
const unsigned int localPort;
const unsigned int remoteAddr;
const unsigned int remotePort;
const std::string processName;
unsigned long long bytesSent;
unsigned long long bytesReceived;
double lastChecked;
protected:
struct timeval monitoringSince;
public:
TTFSession(unsigned int lAddr, unsigned int lPort, unsigned int rAddr, unsigned int rPort, std::string& pName);
double averageUpSpeed(void);
double averageDownSpeed(void);
double timeElapsed(void);
void commitPacket(unsigned char *data);
void disconnect(void);
void status(void);
};
typedef std::tr1::shared_ptr<TTFSession> PTTFSession;