aboutsummaryrefslogtreecommitdiffstats
path: root/src/EtiReader.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2024-01-17 09:03:32 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2024-01-17 09:03:32 +0100
commit01d8415a694bf7a3532e8dc7a6c355cb0ff032cc (patch)
treeb0c6c880a1e7cb605422eb5927d15f7128f20c36 /src/EtiReader.cpp
parent029e9c757549e5d1e8923d10f704fbf31c0ac1ff (diff)
downloaddabmod-01d8415a694bf7a3532e8dc7a6c355cb0ff032cc.tar.gz
dabmod-01d8415a694bf7a3532e8dc7a6c355cb0ff032cc.tar.bz2
dabmod-01d8415a694bf7a3532e8dc7a6c355cb0ff032cc.zip
Remove useless catch, because recv() doesn't throw it
Diffstat (limited to 'src/EtiReader.cpp')
-rw-r--r--src/EtiReader.cpp28
1 files changed, 12 insertions, 16 deletions
diff --git a/src/EtiReader.cpp b/src/EtiReader.cpp
index eda2f23..5726713 100644
--- a/src/EtiReader.cpp
+++ b/src/EtiReader.cpp
@@ -561,7 +561,7 @@ void EdiTransport::Open(const std::string& uri)
m_mcastaddr = host_full.substr(found_mcast+1);
}
else if (found_port != 6) {
- m_bindto=host_full;
+ m_bindto = host_full;
}
etiLog.level(info) << "EDI UDP input: host:" << m_bindto <<
@@ -648,23 +648,19 @@ bool EdiTransport::rxPacket()
// discontinuity.
m_tcpbuffer.resize(512);
const int timeout_ms = 1000;
- try {
- ssize_t ret = m_tcpclient.recv(m_tcpbuffer.data(), m_tcpbuffer.size(), 0, timeout_ms);
- if (ret <= 0) {
- return false;
- }
- else if (ret > (ssize_t)m_tcpbuffer.size()) {
- throw logic_error("EDI TCP: invalid recv() return value");
- }
- else {
- m_tcpbuffer.resize(ret);
- m_decoder.push_bytes(m_tcpbuffer);
- return true;
- }
- }
- catch (const Socket::TCPSocket::Timeout&) {
+
+ ssize_t ret = m_tcpclient.recv(m_tcpbuffer.data(), m_tcpbuffer.size(), 0, timeout_ms);
+ if (ret <= 0) {
return false;
}
+ else if (ret > (ssize_t)m_tcpbuffer.size()) {
+ throw logic_error("EDI TCP: invalid recv() return value");
+ }
+ else {
+ m_tcpbuffer.resize(ret);
+ m_decoder.push_bytes(m_tcpbuffer);
+ return true;
+ }
}
}
throw logic_error("Incomplete rxPacket implementation!");