summaryrefslogtreecommitdiff
path: root/src/session.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2011-05-30 10:07:34 +0200
committerMartin Sustrik <sustrik@250bpm.com>2011-05-30 10:07:34 +0200
commit0b59866a84f733e5a53b0d2f32570581691747ef (patch)
tree8861d97915544dc4385177931f299a6f27603c92 /src/session.cpp
parent311fb0d852374e769d8ff791c9df38f0464960c6 (diff)
Patches from sub-forward branch incorporated
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/session.cpp')
-rw-r--r--src/session.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/session.cpp b/src/session.cpp
index 5601402..c9f4fdb 100644
--- a/src/session.cpp
+++ b/src/session.cpp
@@ -146,6 +146,13 @@ void zmq::session_t::write_activated (pipe_t *pipe_)
engine->activate_in ();
}
+void zmq::session_t::hiccuped (pipe_t *pipe_)
+{
+ // Hiccups are always sent from session to socket, not the other
+ // way round.
+ zmq_assert (false);
+}
+
void zmq::session_t::process_plug ()
{
}
@@ -287,4 +294,25 @@ void zmq::session_t::unregister_session (const blob_t &name_)
socket->unregister_session (name_);
}
+bool zmq::session_t::attached (const blob_t &peer_identity_)
+{
+ return xattached (peer_identity_);
+}
+
+void zmq::session_t::detached ()
+{
+ if (!xdetached ()) {
+
+ // Derived session type have asked for session termination.
+ terminate ();
+ return;
+ }
+
+ // For subscriber sockets we hiccup the inbound pipe, which will cause
+ // the socket object to resend all the subscriptions.
+ if (pipe && (options.type == ZMQ_SUB || options.type == ZMQ_XSUB))
+ pipe->hiccup ();
+}
+
+