diff options
author | Martin Sustrik <sustrik@250bpm.com> | 2010-10-13 10:09:46 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2010-10-13 10:09:46 +0200 |
commit | 9d96e0037a9d027fd286f771fa2a8db5def485c8 (patch) | |
tree | 8fe87b67d46182651a2fb54675ea102e220974f5 /src/named_session.cpp | |
parent | 5ae878b891fa5189f5202f1577d22bdb9ba51f77 (diff) |
Clean-up of the code related to attaching/detaching engines to sessions.
Session base class now handles the engine events exclusively. It notifies
derived session types using dedicated "attached" and "detached" events.
Couple of bugs was fixed along the way.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/named_session.cpp')
-rw-r--r-- | src/named_session.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/named_session.cpp b/src/named_session.cpp index a430091..b6a3acf 100644 --- a/src/named_session.cpp +++ b/src/named_session.cpp @@ -41,14 +41,9 @@ zmq::named_session_t::named_session_t (class io_thread_t *io_thread_, zmq::named_session_t::~named_session_t () { -} - -void zmq::named_session_t::detach () -{ - // Clean up the mess left over by the failed connection. - clean_pipes (); - - // Do nothing. Wait till the connection comes up again. + // Unregister the session from the global list of named sessions. + if (!name.empty ()) + unregister_session (name); } void zmq::named_session_t::attached (const blob_t &peer_identity_) @@ -83,7 +78,7 @@ void zmq::named_session_t::attached (const blob_t &peer_identity_) void zmq::named_session_t::detached () { - unregister_session (name); - session_t::detached (); + // Do nothing. Named sessions are never destroyed because of disconnection, + // neither they have to actively reconnect. } |