From 6be4b0143793ab5ceebc5d9d6bbe5c2f1333a0d2 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Fri, 21 Aug 2009 14:29:22 +0200 Subject: session management implemented --- src/owned.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/owned.cpp') diff --git a/src/owned.cpp b/src/owned.cpp index 6995a39..810bed7 100644 --- a/src/owned.cpp +++ b/src/owned.cpp @@ -47,6 +47,14 @@ void zmq::owned_t::process_plug () finalise_command (); } +void zmq::owned_t::process_attach (zmq_engine_t *engine_) +{ + // Keep track of how many commands were processed so far. + processed_seqnum++; + + finalise_command (); +} + void zmq::owned_t::term () { send_term_req (owner, this); @@ -65,8 +73,8 @@ void zmq::owned_t::finalise_command () // If termination request was already received and there are no more // commands to wait for, terminate the object. if (shutting_down && processed_seqnum == sent_seqnum.get ()) { - send_term_ack (owner); process_unplug (); + send_term_ack (owner); delete this; } } -- cgit v1.2.3