From 858b8ad76757624464c139be2367f0dce53f8c3b Mon Sep 17 00:00:00 2001 From: Martin Lucina Date: Thu, 16 Feb 2012 10:05:18 +0900 Subject: Fix data loss for PUB/SUB and unidirectional transports (LIBZMQ-268) With the introduction of subscription forwarding, the first message sent on a PUB socket using a unidirectional transport (e.g. PGM) is always lost due to the "subscribe to all" being done asynchronously. This patch fixes the problem and also refactors the code to have a single point where the "subscribe to all" is performed. Signed-off-by: Martin Lucina --- src/socket_base.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/socket_base.hpp') diff --git a/src/socket_base.hpp b/src/socket_base.hpp index 01a1564..1e35ffa 100644 --- a/src/socket_base.hpp +++ b/src/socket_base.hpp @@ -102,7 +102,8 @@ namespace xs // Concrete algorithms for the x- methods are to be defined by // individual socket types. - virtual void xattach_pipe (xs::pipe_t *pipe_) = 0; + virtual void xattach_pipe (xs::pipe_t *pipe_, + bool icanhasall_ = false) = 0; // The default implementation assumes there are no specific socket // options for the particular socket type. If not so, overload this @@ -157,7 +158,7 @@ namespace xs int check_protocol (const std::string &protocol_); // Register the pipe with this socket. - void attach_pipe (xs::pipe_t *pipe_); + void attach_pipe (xs::pipe_t *pipe_, bool icanhasall_ = false); // Processes commands sent to this socket (if any). If timeout is -1, // returns only after at least one command was processed. -- cgit v1.2.3