summaryrefslogtreecommitdiff
path: root/src/session.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2010-09-17 12:58:20 +0200
committerMartin Sustrik <sustrik@250bpm.com>2010-09-17 12:58:20 +0200
commitc7b9ba3ccdd5a18afb22dda1afee16c938076c25 (patch)
treecfaab4b02d3c6e7e2437f790364885babd033622 /src/session.cpp
parent85aa25e56cbf6f4194162235fc06bed8683b1bad (diff)
reconnection process fixed when failure occurs during init phase
Diffstat (limited to 'src/session.cpp')
-rw-r--r--src/session.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/session.cpp b/src/session.cpp
index fd6a7ee..eb23eee 100644
--- a/src/session.cpp
+++ b/src/session.cpp
@@ -178,6 +178,14 @@ void zmq::session_t::finalise ()
void zmq::session_t::process_attach (i_engine *engine_,
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
// create them and bind them to the socket object.
reader_t *socket_reader = NULL;