From 1594be8dc12cfcd49ff2ce1b25b6c680666586fb Mon Sep 17 00:00:00 2001 From: Sven Czarnian Date: Thu, 25 Nov 2021 22:26:26 +0100 Subject: [PATCH] adapt to avoid blocking calls --- src/com/Backend.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/com/Backend.cpp b/src/com/Backend.cpp index 0ec52fa..f8bfa59 100644 --- a/src/com/Backend.cpp +++ b/src/com/Backend.cpp @@ -34,6 +34,9 @@ bool Backend::initialize(const Communication& configuration) { return false; if (false == this->setSocketKey(configuration.clientPrivateIdentifier, zmq::sockopt::curve_secretkey)) return false; + this->m_socket->set(zmq::sockopt::rcvtimeo, 500); + this->m_socket->set(zmq::sockopt::req_correlate, 1); + this->m_socket->set(zmq::sockopt::req_relaxed, 1); /* connect to the server */ try { @@ -68,7 +71,6 @@ std::shared_ptr Backend::receiveSequence() { return nullptr; try { - //auto result = this->m_socket->recv(message, zmq::recv_flags::dontwait); auto result = this->m_socket->recv(message); if (false == result.has_value() || 0 == result.value()) return nullptr;