mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-29 12:18:04 +01:00
ZMQII-34: ensure that poll won't return POLLIN event when the message will be filtered out anyway (POSIX)
This commit is contained in:
10
src/sub.hpp
10
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&);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user