From 9e000c8f26c99656dd967a8d15997b879af5817b Mon Sep 17 00:00:00 2001 From: Ben Gray Date: Thu, 27 Oct 2011 13:59:54 +0200 Subject: Patch for issue LIBZMQ-275. Dealing with VSM in distribution when pipes fail to write. Signed-off-by: Ben Gray --- src/dist.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/dist.cpp') diff --git a/src/dist.cpp b/src/dist.cpp index 795e13e..b4fae6f 100644 --- a/src/dist.cpp +++ b/src/dist.cpp @@ -137,6 +137,16 @@ void zmq::dist_t::distribute (msg_t *msg_, int flags_) return; } + if (msg_->is_vsm ()) { + for (pipes_t::size_type i = 0; i < matching; ++i) + write (pipes [i], msg_); + int rc = msg_->close(); + errno_assert (rc == 0); + rc = msg_->init (); + errno_assert (rc == 0); + return; + } + // Add matching-1 references to the message. We already hold one reference, // that's why -1. msg_->add_refs ((int) matching - 1); -- cgit v1.2.3