From d423927765f72c8300f27a46d80452d54c39cbf9 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 7 Aug 2015 10:16:17 +0200 Subject: Use nonblocking management server ZMQ recv --- src/ManagementServer.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/ManagementServer.cpp') diff --git a/src/ManagementServer.cpp b/src/ManagementServer.cpp index 9687278..9a22776 100644 --- a/src/ManagementServer.cpp +++ b/src/ManagementServer.cpp @@ -206,10 +206,12 @@ void ManagementServer::serverThread() while (m_running) { zmq::message_t zmq_message; - m_zmq_sock.recv(&zmq_message); - - - handle_message(zmq_message); + if (m_zmq_sock.recv(&zmq_message, ZMQ_DONTWAIT)) { + handle_message(zmq_message); + } + else { + usleep(10000); + } } m_fault = true; -- cgit v1.2.3