On the advice of Martin Hurton, removed the new command type and just terminated the pipe in a reconnect situation, and notified the socket of the same. This handles the blocking properly, but at the cost of potentially losing in flight messages. However, this is a reasonable trade off given how much simpler it makes the patch.

This commit is contained in:
Ian Barber
2012-06-04 10:27:16 +01:00
parent 1566091bc6
commit c13f1d52ff
6 changed files with 8 additions and 46 deletions

View File

@@ -411,11 +411,14 @@ void zmq::session_base_t::detached ()
// the socket object to resend all the subscriptions.
if (pipe && (options.type == ZMQ_SUB || options.type == ZMQ_XSUB))
pipe->hiccup ();
// For delayed connect situations, hiccup the socket to have it
// pause usage of this pipe
if (outpipe && options.delay_attach_on_connect == 1)
send_detach(socket, outpipe);
// For delayed connect situations, terminate the pipe
// and reestablish later on
if (pipe && options.delay_attach_on_connect == 1) {
pipe->terminate (false);
socket->terminated (pipe);
pipe = NULL;
}
}
void zmq::session_base_t::start_connecting (bool wait_)