mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-18 11:39:02 +02:00
Reverted to a simpler shutdown. This seems to disconnect and reconnect the pipe properly, but there is a problem in overall shutdown when the pipe has blocked and reconnected - the session seems to get terminated() called on it only in shutdown for the original pipe, by which point it has been replaced. I am not sure at the moment why this only happens then, but this does mean this patch is broken at the moment
This commit is contained in:
@@ -308,9 +308,6 @@ void zmq::session_base_t::process_attach (i_engine *engine_)
|
|||||||
|
|
||||||
// Ask socket to plug into the remote end of the pipe.
|
// Ask socket to plug into the remote end of the pipe.
|
||||||
send_bind (socket, pipes [1]);
|
send_bind (socket, pipes [1]);
|
||||||
|
|
||||||
// Store the outpipe for disconnect situations
|
|
||||||
outpipe = pipes [1];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Plug in the engine.
|
// Plug in the engine.
|
||||||
@@ -400,6 +397,14 @@ void zmq::session_base_t::detached ()
|
|||||||
|
|
||||||
reset ();
|
reset ();
|
||||||
|
|
||||||
|
// For delayed connect situations, terminate the pipe
|
||||||
|
// and reestablish later on
|
||||||
|
if (pipe && options.delay_attach_on_connect == 1
|
||||||
|
&& addr->protocol != "pgm" && addr->protocol != "epgm") {
|
||||||
|
pipe->terminate (false);
|
||||||
|
pipe = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
// Reconnect.
|
// Reconnect.
|
||||||
if (options.reconnect_ivl != -1)
|
if (options.reconnect_ivl != -1)
|
||||||
start_connecting (true);
|
start_connecting (true);
|
||||||
@@ -408,14 +413,6 @@ void zmq::session_base_t::detached ()
|
|||||||
// the socket object to resend all the subscriptions.
|
// the socket object to resend all the subscriptions.
|
||||||
if (pipe && (options.type == ZMQ_SUB || options.type == ZMQ_XSUB))
|
if (pipe && (options.type == ZMQ_SUB || options.type == ZMQ_XSUB))
|
||||||
pipe->hiccup ();
|
pipe->hiccup ();
|
||||||
|
|
||||||
// For delayed connect situations, terminate the pipe
|
|
||||||
// and reestablish later on
|
|
||||||
if (pipe && options.delay_attach_on_connect == 1
|
|
||||||
&& addr->protocol != "pgm" && addr->protocol != "epgm") {
|
|
||||||
pipe->terminate (false);
|
|
||||||
outpipe->terminate (false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void zmq::session_base_t::start_connecting (bool wait_)
|
void zmq::session_base_t::start_connecting (bool wait_)
|
||||||
|
@@ -104,9 +104,6 @@ namespace zmq
|
|||||||
// Pipe connecting the session to its socket.
|
// Pipe connecting the session to its socket.
|
||||||
zmq::pipe_t *pipe;
|
zmq::pipe_t *pipe;
|
||||||
|
|
||||||
// Socket end of the pipe, for delay attach scenario
|
|
||||||
zmq::pipe_t *outpipe;
|
|
||||||
|
|
||||||
// This flag is true if the remainder of the message being processed
|
// This flag is true if the remainder of the message being processed
|
||||||
// is still in the in pipe.
|
// is still in the in pipe.
|
||||||
bool incomplete_in;
|
bool incomplete_in;
|
||||||
|
Reference in New Issue
Block a user