aboutsummaryrefslogtreecommitdiffstats
path: root/src/EtiReader.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2019-09-05 11:00:14 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2019-09-05 11:00:14 +0200
commit9f0ded49dd10938ea460deba73845c86736f9bf5 (patch)
treeea88466689dd59b4e164654e5cba497cb3844b67 /src/EtiReader.cpp
parenta4f53e26f1f80d89a5503ca3b33dbd88ee28565e (diff)
downloaddabmod-9f0ded49dd10938ea460deba73845c86736f9bf5.tar.gz
dabmod-9f0ded49dd10938ea460deba73845c86736f9bf5.tar.bz2
dabmod-9f0ded49dd10938ea460deba73845c86736f9bf5.zip
Reduce EDI socket read buffer to avoid ETI frame skip
Diffstat (limited to 'src/EtiReader.cpp')
-rw-r--r--src/EtiReader.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/EtiReader.cpp b/src/EtiReader.cpp
index 05e243c..719966b 100644
--- a/src/EtiReader.cpp
+++ b/src/EtiReader.cpp
@@ -628,7 +628,10 @@ bool EdiTransport::rxPacket()
}
case Proto::TCP:
{
- m_tcpbuffer.resize(4096);
+ // The buffer size must be smaller than the size of two AF Packets, because otherwise
+ // the EDI decoder decodes two in a row and discards the first. This leads to ETI FCT
+ // 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);