diff options
author | Martin Sustrik <sustrik@250bpm.com> | 2011-06-12 15:24:08 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2011-06-12 15:24:08 +0200 |
commit | ff93f54653d099bddfed34a342906a3546e70496 (patch) | |
tree | 36f61ed29ae8f7335ab9086aea6afaa50aeb2305 /src/xsub.cpp | |
parent | e080e3e8b620b0e7ed02c28712a0c92b08de3451 (diff) |
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 <sustrik@250bpm.com>
Diffstat (limited to 'src/xsub.cpp')
-rw-r--r-- | src/xsub.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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; } |