Commit c7b9ba3c authored by Martin Sustrik's avatar Martin Sustrik

reconnection process fixed when failure occurs during init phase

parent 85aa25e5
...@@ -64,7 +64,8 @@ namespace zmq ...@@ -64,7 +64,8 @@ namespace zmq
class own_t *object; class own_t *object;
} own; } own;
// Attach the engine to the session. // Attach the engine to the session. If engine is NULL, it informs
// session that the connection have failed.
struct { struct {
struct i_engine *engine; struct i_engine *engine;
unsigned char peer_identity_size; unsigned char peer_identity_size;
......
...@@ -178,6 +178,14 @@ void zmq::session_t::finalise () ...@@ -178,6 +178,14 @@ void zmq::session_t::finalise ()
void zmq::session_t::process_attach (i_engine *engine_, void zmq::session_t::process_attach (i_engine *engine_,
const blob_t &peer_identity_) const blob_t &peer_identity_)
{ {
// If some other object (e.g. init) notifies us that the connection failed
// we need to start the reconnection process.
if (!engine_) {
zmq_assert (!engine);
detached ();
return;
}
// Check whether the required pipes already exist. If not so, we'll // Check whether the required pipes already exist. If not so, we'll
// create them and bind them to the socket object. // create them and bind them to the socket object.
reader_t *socket_reader = NULL; reader_t *socket_reader = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment