summaryrefslogtreecommitdiff
path: root/src/pgm_sender.cpp
diff options
context:
space:
mode:
authorMartin Lucina <martin@lucina.net>2012-02-16 10:05:18 +0900
committerMartin Sustrik <sustrik@250bpm.com>2012-02-16 10:05:18 +0900
commit858b8ad76757624464c139be2367f0dce53f8c3b (patch)
treebf174496a722d151d33e861f9bdd43a199007b1d /src/pgm_sender.cpp
parentcfba1f07987434263843f4aaee11ec088ec6ced3 (diff)
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 <martin@lucina.net>
Diffstat (limited to 'src/pgm_sender.cpp')
-rw-r--r--src/pgm_sender.cpp10
1 files changed, 0 insertions, 10 deletions
diff --git a/src/pgm_sender.cpp b/src/pgm_sender.cpp
index f68c044..dde6284 100644
--- a/src/pgm_sender.cpp
+++ b/src/pgm_sender.cpp
@@ -92,16 +92,6 @@ void xs::pgm_sender_t::plug (io_thread_t *io_thread_, session_base_t *session_)
// Set POLLOUT for downlink_socket_handle.
set_pollout (handle);
-
- // PGM is not able to pass subscriptions upstream, thus we have no idea
- // what messages are peers interested in. Because of that we have to
- // subscribe for all the messages.
- msg_t msg;
- msg.init_size (1);
- *(unsigned char*) msg.data () = 1;
- int rc = session_->write (&msg);
- errno_assert (rc == 0);
- session_->flush ();
}
void xs::pgm_sender_t::unplug ()