summaryrefslogtreecommitdiffstats
path: root/src/zmq2edi/zmq2edi.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-08-06 15:52:21 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-08-06 15:52:21 +0200
commit6db7ccca948f94570b86b82970afeb4ed7be718f (patch)
tree7213dcc2ec5d48f6c1476861c1ed18d58141f22e /src/zmq2edi/zmq2edi.cpp
parentb9afad6f157ca35dada1ee48e0239bcb04b6ec4b (diff)
downloaddabmux-6db7ccca948f94570b86b82970afeb4ed7be718f.tar.gz
dabmux-6db7ccca948f94570b86b82970afeb4ed7be718f.tar.bz2
dabmux-6db7ccca948f94570b86b82970afeb4ed7be718f.zip
zmq2edi: Add option to drop late packets
Diffstat (limited to 'src/zmq2edi/zmq2edi.cpp')
-rw-r--r--src/zmq2edi/zmq2edi.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/zmq2edi/zmq2edi.cpp b/src/zmq2edi/zmq2edi.cpp
index b2c20f4..3364faa 100644
--- a/src/zmq2edi/zmq2edi.cpp
+++ b/src/zmq2edi/zmq2edi.cpp
@@ -55,6 +55,7 @@ void usage(void)
cerr << "The following options can be given only once:" << endl;
cerr << " <source> is a ZMQ URL that points to a ODR-DabMux ZMQ output." << endl;
cerr << " -w <delay> Keep every ETI frame until TIST is <delay> milliseconds after current system time." << endl;
+ cerr << " -x Drop frames where for which the wait time would be negative, i.e. frames that arrived too late." << endl;
cerr << " -p <destination port> sets the destination port." << endl;
cerr << " -P Disable PFT and send AFPackets." << endl;
cerr << " -f <fec> sets the FEC." << endl;
@@ -223,10 +224,11 @@ int start(int argc, char **argv)
}
int delay_ms = 500;
+ bool drop_late_packets = false;
int ch = 0;
while (ch != -1) {
- ch = getopt(argc, argv, "d:p:s:S:t:Pf:i:Dva:w:");
+ ch = getopt(argc, argv, "d:p:s:S:t:Pf:i:Dva:w:x");
switch (ch) {
case -1:
break;
@@ -274,6 +276,9 @@ int start(int argc, char **argv)
case 'w':
delay_ms = std::stoi(optarg);
break;
+ case 'x':
+ drop_late_packets = true;
+ break;
case 'h':
default:
usage();
@@ -298,8 +303,9 @@ int start(int argc, char **argv)
return 1;
}
- etiLog.level(info) << "Setting up EDI Sender with delay " << delay_ms << " ms";
- edisender.start(edi_conf, delay_ms);
+ etiLog.level(info) << "Setting up EDI Sender with delay " << delay_ms << " ms. " <<
+ (drop_late_packets ? "Will" : "Will not") << " drop late packets";
+ edisender.start(edi_conf, delay_ms, drop_late_packets);
edisender.print_configuration();
const char* source_url = argv[optind];