mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-25 06:30:00 -04:00
Merge pull request #1509 from RetroPooh/trafcount
display session traffic
This commit is contained in:
commit
43a5312194
12 changed files with 59 additions and 11 deletions
|
@ -186,7 +186,7 @@ class NetInterface;
|
|||
class PQInterface: public RateInterface
|
||||
{
|
||||
public:
|
||||
explicit PQInterface(const RsPeerId &id) :peerId(id) { return; }
|
||||
explicit PQInterface(const RsPeerId &id) :peerId(id), traf_in(0), traf_out(0) { return; }
|
||||
virtual ~PQInterface() { return; }
|
||||
|
||||
/*!
|
||||
|
@ -228,6 +228,22 @@ class PQInterface: public RateInterface
|
|||
const sockaddr_storage & /*remote_peer_address*/)
|
||||
{ return 0; }
|
||||
|
||||
virtual uint64_t getTraffic(bool in)
|
||||
{
|
||||
uint64_t ret = 0;
|
||||
if (in)
|
||||
{
|
||||
ret = traf_in;
|
||||
traf_in = 0;
|
||||
return ret;
|
||||
}
|
||||
ret = traf_out;
|
||||
traf_out = 0;
|
||||
return ret;
|
||||
}
|
||||
uint64_t traf_in;
|
||||
uint64_t traf_out;
|
||||
|
||||
private:
|
||||
|
||||
RsPeerId peerId;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue