diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/publisher/trex_publisher.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/publisher/trex_publisher.cpp b/src/publisher/trex_publisher.cpp index dc37d14c..f5437378 100644 --- a/src/publisher/trex_publisher.cpp +++ b/src/publisher/trex_publisher.cpp @@ -73,6 +73,13 @@ TrexPublisher::Create(uint16_t port, bool disable){ void TrexPublisher::Delete(){ if (m_publisher) { + + /* before calling zmq_close set the linger property to zero + (othersie zmq_ctx_destroy might hang forever) + */ + int val = 0; + zmq_setsockopt(m_publisher, ZMQ_LINGER, &val, sizeof(val)); + zmq_close (m_publisher); m_publisher = NULL; } |