adapt to avoid blocking calls
This commit is contained in:
@@ -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<aman::AircraftSequence> 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;
|
||||
|
||||
Reference in New Issue
Block a user