From e6af6434faae9812763dc0064450eb7c34a38fd6 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Mon, 15 Mar 2021 15:41:25 +0100 Subject: Common c90e505: Fix EDI UDP packet spreading set to 0 --- lib/edioutput/Transport.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/edioutput/Transport.cpp b/lib/edioutput/Transport.cpp index 136c71c..274f7ec 100644 --- a/lib/edioutput/Transport.cpp +++ b/lib/edioutput/Transport.cpp @@ -135,14 +135,17 @@ void Sender::write(const TagPacket& tagpacket) edi_fragments.size()); } - /* Spread out the transmission of all fragments over 25% of the 24ms AF packet duration + /* Spread out the transmission of all fragments over part of the 24ms AF packet duration * to reduce the risk of losing a burst of fragments because of congestion. */ using namespace std::chrono; - auto inter_fragment_wait_time = microseconds(0); + auto inter_fragment_wait_time = microseconds(1); if (edi_fragments.size() > 1) { - inter_fragment_wait_time = microseconds( - llrint(m_conf.fragment_spreading_factor * 24000.0 / edi_fragments.size()) - ); + if (m_conf.fragment_spreading_factor > 0) { + inter_fragment_wait_time = + microseconds( + llrint(m_conf.fragment_spreading_factor * 24000.0 / edi_fragments.size()) + ); + } } /* Separate insertion into map and transmission so as to make spreading possible */ -- cgit v1.2.3