display session traffic

This commit is contained in:
RetroPooh 2019-04-03 17:29:13 +03:00
parent c19919962d
commit 7504964899
11 changed files with 58 additions and 11 deletions

View file

@ -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;