From 9d96e0037a9d027fd286f771fa2a8db5def485c8 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Wed, 13 Oct 2010 10:09:46 +0200 Subject: 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 --- src/session.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/session.hpp') 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 (); -- cgit v1.2.3