mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-28 19:52:00 +01:00
Actual message filtering happens in XPUB socket
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
This commit is contained in:
16
src/xpub.cpp
16
src/xpub.cpp
@@ -91,9 +91,21 @@ void zmq::xpub_t::xterminated (pipe_t *pipe_)
|
||||
dist.terminated (pipe_);
|
||||
}
|
||||
|
||||
void zmq::xpub_t::mark_as_matching (pipe_t *pipe_, void *arg_)
|
||||
{
|
||||
xpub_t *self = (xpub_t*) arg_;
|
||||
self->dist.match (pipe_);
|
||||
}
|
||||
|
||||
int zmq::xpub_t::xsend (msg_t *msg_, int flags_)
|
||||
{
|
||||
return dist.send (msg_, flags_);
|
||||
{
|
||||
// Find the matching pipes.
|
||||
subscriptions.match ((unsigned char*) msg_->data (), msg_->size (),
|
||||
mark_as_matching, this);
|
||||
|
||||
// Send the message to all the pipes that were marked as matching
|
||||
// in the previous step.
|
||||
return dist.send_to_matching (msg_, flags_);
|
||||
}
|
||||
|
||||
bool zmq::xpub_t::xhas_out ()
|
||||
|
||||
Reference in New Issue
Block a user