mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-24 13:59:29 -04:00
display session traffic
This commit is contained in:
parent
c19919962d
commit
7504964899
11 changed files with 58 additions and 11 deletions
|
@ -192,7 +192,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; }
|
||||
|
||||
/*!
|
||||
|
@ -234,6 +234,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