|
|
@ -10,6 +10,7 @@ |
|
|
|
#include <queue> |
|
|
|
#include <queue> |
|
|
|
#include <string> |
|
|
|
#include <string> |
|
|
|
#include <memory> |
|
|
|
#include <memory> |
|
|
|
|
|
|
|
#include <atomic> |
|
|
|
#include <cryptopp/osrng.h> |
|
|
|
#include <cryptopp/osrng.h> |
|
|
|
#include <boost/asio.hpp> |
|
|
|
#include <boost/asio.hpp> |
|
|
|
#include "TransportSession.h" |
|
|
|
#include "TransportSession.h" |
|
|
@ -88,6 +89,11 @@ namespace transport |
|
|
|
void PeerConnected (std::shared_ptr<TransportSession> session); |
|
|
|
void PeerConnected (std::shared_ptr<TransportSession> session); |
|
|
|
void PeerDisconnected (std::shared_ptr<TransportSession> session); |
|
|
|
void PeerDisconnected (std::shared_ptr<TransportSession> session); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UpdateSentBytes (uint64_t numBytes) { m_TotalSentBytes += numBytes; }; |
|
|
|
|
|
|
|
void UpdateReceivedBytes (uint64_t numBytes) { m_TotalReceivedBytes += numBytes; }; |
|
|
|
|
|
|
|
uint64_t GetTotalSentBytes () const { return m_TotalSentBytes; }; |
|
|
|
|
|
|
|
uint64_t GetTotalReceivedBytes () const { return m_TotalReceivedBytes; }; |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
|
|
|
|
|
|
|
|
void Run (); |
|
|
|
void Run (); |
|
|
@ -118,6 +124,7 @@ namespace transport |
|
|
|
std::map<i2p::data::IdentHash, Peer> m_Peers; |
|
|
|
std::map<i2p::data::IdentHash, Peer> m_Peers; |
|
|
|
|
|
|
|
|
|
|
|
DHKeysPairSupplier m_DHKeysPairSupplier; |
|
|
|
DHKeysPairSupplier m_DHKeysPairSupplier; |
|
|
|
|
|
|
|
std::atomic<uint64_t> m_TotalSentBytes, m_TotalReceivedBytes; |
|
|
|
|
|
|
|
|
|
|
|
public: |
|
|
|
public: |
|
|
|
|
|
|
|
|
|
|
|