diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2025-03-11 16:47:14 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2025-03-11 16:47:14 +0100 |
commit | 20be04f39e6998d9f9346e86c4d12f0bb4aa9eb2 (patch) | |
tree | 65732b6a55eaf8bd72ccb3ad39439ad0dbf78571 /contrib/Socket.h | |
parent | cd7b439f4c70230fa88f84843a23468e399d6029 (diff) | |
download | ODR-AudioEnc-20be04f39e6998d9f9346e86c4d12f0bb4aa9eb2.tar.gz ODR-AudioEnc-20be04f39e6998d9f9346e86c4d12f0bb4aa9eb2.tar.bz2 ODR-AudioEnc-20be04f39e6998d9f9346e86c4d12f0bb4aa9eb2.zip |
Update common 5959418next
Diffstat (limited to 'contrib/Socket.h')
-rw-r--r-- | contrib/Socket.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/contrib/Socket.h b/contrib/Socket.h index 7709145..29b618a 100644 --- a/contrib/Socket.h +++ b/contrib/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(); |