summaryrefslogtreecommitdiff
path: root/src/session.hpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2010-10-13 10:09:46 +0200
committerMartin Sustrik <sustrik@250bpm.com>2010-10-13 10:09:46 +0200
commit9d96e0037a9d027fd286f771fa2a8db5def485c8 (patch)
tree8fe87b67d46182651a2fb54675ea102e220974f5 /src/session.hpp
parent5ae878b891fa5189f5202f1577d22bdb9ba51f77 (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/session.hpp')
-rw-r--r--src/session.hpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/session.hpp b/src/session.hpp
index 7e528de..0f90e80 100644
--- a/src/session.hpp
+++ b/src/session.hpp
@@ -70,8 +70,8 @@ namespace zmq
// when session is attached to a peer, detached is triggered at the
// beginning of the termination process when session is about to
// be detached from the peer.
- virtual void attached (const blob_t &peer_identity_);
- virtual void detached ();
+ virtual void attached (const blob_t &peer_identity_) = 0;
+ virtual void detached () = 0;
// Allows derives session types to (un)register session names.
bool register_session (const blob_t &name_, class session_t *session_);
@@ -79,10 +79,6 @@ namespace zmq
~session_t ();
- // Remove any half processed messages. Flush unflushed messages.
- // Call this function when engine disconnect to get rid of leftovers.
- void clean_pipes ();
-
// Inherited socket options. These are visible to all session classes.
options_t options;
@@ -94,6 +90,10 @@ namespace zmq
const blob_t &peer_identity_);
void process_term ();
+ // Remove any half processed messages. Flush unflushed messages.
+ // Call this function when engine disconnect to get rid of leftovers.
+ void clean_pipes ();
+
// Call this function to move on with the delayed process_term.
void proceed_with_term ();