From 969522bbf55467b6f6e8113be28451d087060843 Mon Sep 17 00:00:00 2001 From: malosek Date: Wed, 16 Sep 2009 10:11:01 +0200 Subject: added OpenPGM receiver - ZMQ_SUB --- src/sub.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/sub.cpp') diff --git a/src/sub.cpp b/src/sub.cpp index 51e0c23..101c62f 100644 --- a/src/sub.cpp +++ b/src/sub.cpp @@ -101,6 +101,12 @@ int zmq::sub_t::recv (struct zmq_msg_t *msg_, int flags_) if (rc != 0 && errno == EAGAIN) return -1; + // If there is no subscription return -1/EAGAIN. + if (!all_count && prefixes.empty () && topics.empty ()) { + errno = EAGAIN; + return -1; + } + // If there is at least one "*" subscription, the message matches. if (all_count) return 0; -- cgit v1.2.3