aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2021-02-10 12:05:31 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2021-02-10 12:05:31 +0100
commit6bfd16f561c292fec0b42316f3c22d901ef038ed (patch)
treec2f3075bd3b42696c77890ba8dc391e1c4e4eabf
parent9a9a9a8c20127eaf1b5138e140f0695e1e7473c3 (diff)
downloadODR-EDI2EDI-6bfd16f561c292fec0b42316f3c22d901ef038ed.tar.gz
ODR-EDI2EDI-6bfd16f561c292fec0b42316f3c22d901ef038ed.tar.bz2
ODR-EDI2EDI-6bfd16f561c292fec0b42316f3c22d901ef038ed.zip
Common 64b6f10: Fix UDP EDI packet output spreading
-rw-r--r--lib/edioutput/Transport.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/edioutput/Transport.cpp b/lib/edioutput/Transport.cpp
index cfed9ec..f8e5dc7 100644
--- a/lib/edioutput/Transport.cpp
+++ b/lib/edioutput/Transport.cpp
@@ -132,11 +132,14 @@ void Sender::write(const TagPacket& tagpacket)
edi_fragments.size());
}
- /* Spread out the transmission of all fragments over 75% of the 24ms AF packet duration
- * to reduce the risk of losing fragments because of congestion.
+ /* Spread out the transmission of all fragments over 25% of the 24ms AF packet duration
+ * to reduce the risk of losing a burst of fragments because of congestion.
*
- * 75% was chosen so that other outputs still have time to do their thing. */
- const auto inter_fragment_wait_time = std::chrono::microseconds(llrint(0.75 * 24000.0 / edi_fragments.size()));
+ * 25% was chosen so that other outputs still have time to do their thing. */
+ auto inter_fragment_wait_time = std::chrono::microseconds(0);
+ if (edi_fragments.size() > 1) {
+ inter_fragment_wait_time = std::chrono::microseconds(llrint(0.25 * 24000.0 / edi_fragments.size()));
+ }
// Send over ethernet
for (auto& edi_frag : edi_fragments) {