summaryrefslogtreecommitdiff
path: root/src/session.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2010-08-11 17:06:49 +0200
committerMartin Sustrik <sustrik@250bpm.com>2010-08-25 15:39:20 +0200
commit76bd6e73c335dbebd8bd30565f83a810058f2cc8 (patch)
treeb3db6f4bbecfe796fb53b4ab968aaf06349817ba /src/session.cpp
parentd13933bc62fce71b5a58118020e0dd3776e79aa9 (diff)
engine termination on disconnect fixed
Diffstat (limited to 'src/session.cpp')
-rw-r--r--src/session.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/session.cpp b/src/session.cpp
index 0494ff1..e208ebf 100644
--- a/src/session.cpp
+++ b/src/session.cpp
@@ -49,8 +49,10 @@ zmq::session_t::~session_t ()
void zmq::session_t::terminate ()
{
- // TODO:
- zmq_assert (false);
+ if (in_pipe)
+ in_pipe->terminate ();
+ if (out_pipe)
+ out_pipe->terminate ();
}
bool zmq::session_t::read (::zmq_msg_t *msg_)
@@ -228,6 +230,14 @@ void zmq::session_t::process_attach (i_engine *engine_,
attached (peer_identity_);
}
+void zmq::session_t::detach ()
+{
+ // Engine is dead. Let's forget about it.
+ engine = NULL;
+
+ detached ();
+}
+
void zmq::session_t::process_term ()
{
// Here we are pugging into the own_t's termination mechanism.