From 067ba3b9f77a253d4ce58e05ef1fa7702c32b2a3 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Wed, 13 Jan 2010 19:21:23 +0100 Subject: ZMQII-34: ensure that poll won't return POLLIN event when the message will be filtered out anyway (POSIX) --- src/sub.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/sub.hpp') 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 #include +#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 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&); }; -- cgit v1.2.3