diff options
author | Martin Sustrik <sustrik@fastmq.commkdir> | 2010-01-13 19:21:23 +0100 |
---|---|---|
committer | Martin Sustrik <sustrik@fastmq.commkdir> | 2010-01-13 19:21:23 +0100 |
commit | 067ba3b9f77a253d4ce58e05ef1fa7702c32b2a3 (patch) | |
tree | f7e5b694a2e65059ac6c041b0640101229a0d9df /src/sub.hpp | |
parent | 06105d164230800e8ea42ddd513e2f7fb27e6f2f (diff) |
ZMQII-34: ensure that poll won't return POLLIN event when the message will be filtered out anyway (POSIX)
Diffstat (limited to 'src/sub.hpp')
-rw-r--r-- | src/sub.hpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/sub.hpp b/src/sub.hpp index df7d369..2044442 100644 --- a/src/sub.hpp +++ b/src/sub.hpp @@ -23,6 +23,8 @@ #include <set> #include <string> +#include "../bindings/c/zmq.h" + #include "socket_base.hpp" #include "fq.hpp" @@ -53,6 +55,9 @@ namespace zmq private: + // Check whether the message matches at least one subscription. + bool match (zmq_msg_t *msg_); + // Fair queueing object for inbound pipes. fq_t fq; @@ -62,6 +67,11 @@ namespace zmq typedef std::multiset <std::string> subscriptions_t; subscriptions_t subscriptions; + // If true, 'message' contains a matching message to return on the + // next recv call. + bool has_message; + zmq_msg_t message; + sub_t (const sub_t&); void operator = (const sub_t&); }; |