summaryrefslogtreecommitdiff
path: root/src/session.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2010-08-24 11:19:22 +0200
committerMartin Sustrik <sustrik@250bpm.com>2010-08-25 15:39:21 +0200
commit9b8993efb48ccbe3df917338cc078129b5af495b (patch)
treec9234c0c67d26818cb5691951bbffd9c1cd015b0 /src/session.cpp
parent46d70555659c05a0c8d95c6d7aa8c7e0cc5ebc66 (diff)
elementary fixes to the named session
Diffstat (limited to 'src/session.cpp')
-rw-r--r--src/session.cpp37
1 files changed, 11 insertions, 26 deletions
diff --git a/src/session.cpp b/src/session.cpp
index ea264f1..fd6a7ee 100644
--- a/src/session.cpp
+++ b/src/session.cpp
@@ -163,31 +163,6 @@ void zmq::session_t::process_plug ()
{
}
-void zmq::session_t::process_unplug ()
-{
- // TODO: There may be a problem here. The called ensures that all the
- // commands on the fly have been delivered. However, given that the
- // session is unregistered from the global repository only at this point
- // there may be some commands being sent to the session right now.
-
- // Unregister the session from the socket.
-// if (!peer_identity.empty () && peer_identity [0] != 0)
-// unregister_session (peer_identity);
-// TODO: Should be done in named session.
-
- // Ask associated pipes to terminate.
- if (in_pipe)
- in_pipe->terminate ();
- if (out_pipe)
- out_pipe->terminate ();
-
- if (engine) {
- engine->unplug ();
- delete engine;
- engine = NULL;
- }
-}
-
void zmq::session_t::finalise ()
{
// If all conditions are met, proceed with termination:
@@ -221,7 +196,7 @@ void zmq::session_t::process_attach (i_engine *engine_,
}
if (socket_reader || socket_writer)
- send_bind (socket, socket_reader, socket_writer, peer_identity);
+ send_bind (socket, socket_reader, socket_writer, peer_identity_);
// Plug in the engine.
zmq_assert (!engine);
@@ -252,6 +227,16 @@ void zmq::session_t::process_term ()
finalise ();
}
+bool zmq::session_t::register_session (const blob_t &name_, session_t *session_)
+{
+ return socket->register_session (name_, session_);
+}
+
+void zmq::session_t::unregister_session (const blob_t &name_)
+{
+ socket->unregister_session (name_);
+}
+
void zmq::session_t::attached (const blob_t &peer_identity_)
{
}