From 3d0534fa8bfaa7458e39e0c12255e341bd58b1c5 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Thu, 11 Oct 2018 15:51:38 +0200 Subject: Set zmq socket linger to avoid lockup at teardown --- src/odr-audioenc.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/odr-audioenc.cpp b/src/odr-audioenc.cpp index 3b42dfd..9f88a4b 100644 --- a/src/odr-audioenc.cpp +++ b/src/odr-audioenc.cpp @@ -764,6 +764,10 @@ int main(int argc, char *argv[]) zmq::context_t zmq_ctx; zmq::socket_t zmq_sock(zmq_ctx, ZMQ_PUB); + // Do not wait at teardown to send all data out + int linger = 0; + zmq_sock.setsockopt(ZMQ_LINGER, &linger, sizeof(linger)); + if (not output_uris.empty()) { for (auto uri : output_uris) { if (uri == "-") { -- cgit v1.2.3