diff options
| author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2020-05-11 21:30:35 +0200 |
|---|---|---|
| committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2020-05-11 21:30:35 +0200 |
| commit | ed1a35bf8bf8be0e3f3b12c2e9332dfcd86a817b (patch) | |
| tree | 6bbbcfb086b74381146c63fbc73b882b82495279 /lib/Socket.cpp | |
| parent | 9a30ccf89e93f970832465ae1c443c684ba9e0bf (diff) | |
| download | ODR-SourceCompanion-ed1a35bf8bf8be0e3f3b12c2e9332dfcd86a817b.tar.gz ODR-SourceCompanion-ed1a35bf8bf8be0e3f3b12c2e9332dfcd86a817b.tar.bz2 ODR-SourceCompanion-ed1a35bf8bf8be0e3f3b12c2e9332dfcd86a817b.zip | |
Update common
Diffstat (limited to 'lib/Socket.cpp')
| -rw-r--r-- | lib/Socket.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Socket.cpp b/lib/Socket.cpp index 159de7e..bc1b179 100644 --- a/lib/Socket.cpp +++ b/lib/Socket.cpp @@ -2,7 +2,7 @@ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Her Majesty the Queen in Right of Canada (Communications Research Center Canada) - Copyright (C) 2019 + Copyright (C) 2020 Matthias P. Braendli, matthias.braendli@mpb.li http://www.opendigitalradio.org @@ -932,6 +932,11 @@ void TCPSendClient::sendall(const std::vector<uint8_t>& buffer) } m_queue.push(buffer); + + if (m_queue.size() > MAX_QUEUE_SIZE) { + vector<uint8_t> discard; + m_queue.try_pop(discard); + } } void TCPSendClient::process() |
