From bd86def1c799a35d5cef0c0a9a1347a18fea227e Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Sat, 11 Jun 2011 20:29:56 +0200 Subject: Actual message filtering happens in XPUB socket Signed-off-by: Martin Sustrik --- src/dist.hpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/dist.hpp') diff --git a/src/dist.hpp b/src/dist.hpp index 10613c1..005bb60 100644 --- a/src/dist.hpp +++ b/src/dist.hpp @@ -38,11 +38,26 @@ namespace zmq dist_t (); ~dist_t (); + // Adds the pipe to the distributor object. void attach (class pipe_t *pipe_); + + // Activates pipe that have previously reached high watermark. void activated (class pipe_t *pipe_); + + // Mark the pipe as matching. Subsequent call to send_to_matching + // will send message also to this pipe. + void match (class pipe_t *pipe_); + + // Removes the pipe from the distributor object. void terminated (class pipe_t *pipe_); - int send (class msg_t *msg_, int flags_); + // Send the message to all the outbound pipes. After the call all the + // pipes are marked as non-matching. + int send_to_matching (class msg_t *msg_, int flags_); + + // Send the message to the matching outbound pipes. + int send_to_all (class msg_t *msg_, int flags_); + bool has_out (); private: @@ -58,6 +73,9 @@ namespace zmq typedef array_t pipes_t; pipes_t pipes; + // Number of all the pipes to send the next message to. + pipes_t::size_type matching; + // Number of active pipes. All the active pipes are located at the // beginning of the pipes array. These are the pipes the messages // can be sent to at the moment. -- cgit v1.2.3