From 9f0ded49dd10938ea460deba73845c86736f9bf5 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Thu, 5 Sep 2019 11:00:14 +0200 Subject: Reduce EDI socket read buffer to avoid ETI frame skip --- src/EtiReader.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') 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); -- cgit v1.2.3