diff --git a/fairmq/nanomsg/FairMQSocketNN.cxx b/fairmq/nanomsg/FairMQSocketNN.cxx index ce9130eb..b219782b 100644 --- a/fairmq/nanomsg/FairMQSocketNN.cxx +++ b/fairmq/nanomsg/FairMQSocketNN.cxx @@ -138,7 +138,11 @@ int FairMQSocketNN::Send(FairMQMessagePtr& msg, const int flags) return nbytes; } +#if NN_VERSION_CURRENT>2 // backwards-compatibility with nanomsg version<=0.6 else if (nn_errno() == ETIMEDOUT) +#else + else if (nn_errno() == EAGAIN) +#endif { if (!fInterrupted && ((flags & NN_DONTWAIT) == 0)) { @@ -182,7 +186,11 @@ int FairMQSocketNN::Receive(FairMQMessagePtr& msg, const int flags) static_cast(msg.get())->fReceiving = true; return nbytes; } +#if NN_VERSION_CURRENT>2 // backwards-compatibility with nanomsg version<=0.6 else if (nn_errno() == ETIMEDOUT) +#else + else if (nn_errno() == EAGAIN) +#endif { if (!fInterrupted && ((flags & NN_DONTWAIT) == 0)) { @@ -239,7 +247,11 @@ int64_t FairMQSocketNN::Send(vector>& msgVec, const in ++fMessagesTx; return nbytes; } +#if NN_VERSION_CURRENT>2 // backwards-compatibility with nanomsg version<=0.6 else if (nn_errno() == ETIMEDOUT) +#else + else if (nn_errno() == EAGAIN) +#endif { if (!fInterrupted && ((flags & NN_DONTWAIT) == 0)) { @@ -317,7 +329,11 @@ int64_t FairMQSocketNN::Receive(vector>& msgVec, const nn_freemsg(ptr); return nbytes; } +#if NN_VERSION_CURRENT>2 // backwards-compatibility with nanomsg version<=0.6 else if (nn_errno() == ETIMEDOUT) +#else + else if (nn_errno() == EAGAIN) +#endif { if (!fInterrupted && ((flags & NN_DONTWAIT) == 0)) {