diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-10-11 15:51:38 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-10-11 15:51:38 +0200 |
commit | 3d0534fa8bfaa7458e39e0c12255e341bd58b1c5 (patch) | |
tree | 3e59c7c6bfbfe779bd7410525c64721c4e2e7cce | |
parent | 7f9c0a810b6028680d14a9b479a61b37ffa10f83 (diff) | |
download | ODR-AudioEnc-3d0534fa8bfaa7458e39e0c12255e341bd58b1c5.tar.gz ODR-AudioEnc-3d0534fa8bfaa7458e39e0c12255e341bd58b1c5.tar.bz2 ODR-AudioEnc-3d0534fa8bfaa7458e39e0c12255e341bd58b1c5.zip |
Set zmq socket linger to avoid lockup at teardown
-rw-r--r-- | src/odr-audioenc.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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 == "-") { |