From ff93f54653d099bddfed34a342906a3546e70496 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Sun, 12 Jun 2011 15:24:08 +0200 Subject: ZMQ_FILTER socket option added This option is a performance tweak. In devices XSUB socket filters the messages just to send them to XPUB socket which filters them once more. Setting ZMQ_FILTER option to 0 allows to switch the filtering in XSUB socket off. Signed-off-by: Martin Sustrik --- src/xsub.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/xsub.cpp') diff --git a/src/xsub.cpp b/src/xsub.cpp index a847d7f..60ba598 100644 --- a/src/xsub.cpp +++ b/src/xsub.cpp @@ -133,7 +133,7 @@ int zmq::xsub_t::xrecv (msg_t *msg_, int flags_) // Check whether the message matches at least one subscription. // Non-initial parts of the message are passed - if (more || match (msg_)) { + if (more || !options.filter || match (msg_)) { more = msg_->flags () & msg_t::more; return 0; } @@ -173,7 +173,7 @@ bool zmq::xsub_t::xhas_in () } // Check whether the message matches at least one subscription. - if (match (&message)) { + if (!options.filter || match (&message)) { has_message = true; return true; } -- cgit v1.2.3