diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2025-03-11 16:48:39 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2025-03-11 16:48:39 +0100 |
commit | 228ec291a58869a19b368a536f3ea0fcd97a57b6 (patch) | |
tree | 957d2be8f67f0fbd6ae70c49e3705061982c8fbf /lib/Socket.h | |
parent | b2a964b6338466b74d6ef217f7453a1c7c2f72c9 (diff) | |
download | ODR-SourceCompanion-228ec291a58869a19b368a536f3ea0fcd97a57b6.tar.gz ODR-SourceCompanion-228ec291a58869a19b368a536f3ea0fcd97a57b6.tar.bz2 ODR-SourceCompanion-228ec291a58869a19b368a536f3ea0fcd97a57b6.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(); |