diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2025-03-11 16:45:11 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2025-03-11 16:45:11 +0100 |
commit | 31115439d68bacaecc095a075ae34293123662e9 (patch) | |
tree | 1e317481d6e1b5a18439ef18340bdbf4181dd6f8 /lib/Socket.h | |
parent | 567c8d98a283d36cdb08e7457dca05fb3fd71d72 (diff) | |
download | dabmod-31115439d68bacaecc095a075ae34293123662e9.tar.gz dabmod-31115439d68bacaecc095a075ae34293123662e9.tar.bz2 dabmod-31115439d68bacaecc095a075ae34293123662e9.zip |
Update common 5959418next
Diffstat (limited to 'lib/Socket.h')
-rw-r--r-- | lib/Socket.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Socket.h b/lib/Socket.h index 7709145..29b618a 100644 --- a/lib/Socket.h +++ b/lib/Socket.h @@ -213,6 +213,8 @@ class TCPSocket { SOCKET get_sockfd() const { return m_sock; } + InetAddress get_remote_address() const { return m_remote_address; } + private: explicit TCPSocket(int sockfd); explicit TCPSocket(int sockfd, InetAddress remote_address); @@ -254,6 +256,12 @@ class TCPConnection ThreadsafeQueue<std::vector<uint8_t> > queue; + struct stats_t { + size_t buffer_fullness = 0; + InetAddress remote_address; + }; + stats_t get_stats() const; + private: std::atomic<bool> m_running; std::thread m_sender_thread; @@ -276,6 +284,8 @@ class TCPDataDispatcher void start(int port, const std::string& address); void write(const std::vector<uint8_t>& data); + std::vector<TCPConnection::stats_t> get_stats() const; + private: void process(); |