From 059beca59d39d90a8ee0e1b07f840994962ea89e Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Wed, 12 Aug 2009 09:40:16 +0200 Subject: listener/connecter/init/session added --- src/io_object.cpp | 47 ++++------------------------------------------- 1 file changed, 4 insertions(+), 43 deletions(-) (limited to 'src/io_object.cpp') diff --git a/src/io_object.cpp b/src/io_object.cpp index d8cc1c0..f61e5f0 100644 --- a/src/io_object.cpp +++ b/src/io_object.cpp @@ -21,35 +21,19 @@ #include "io_thread.hpp" #include "err.hpp" -zmq::io_object_t::io_object_t (io_thread_t *parent_, object_t *owner_) : - object_t (parent_), - owner (owner_), - plugged_in (false), - terminated (false) +zmq::io_object_t::io_object_t (io_thread_t *io_thread_) { // Retrieve the poller from the thread we are running in. - poller = parent_->get_poller (); + poller = io_thread_->get_poller (); } zmq::io_object_t::~io_object_t () { } -void zmq::io_object_t::process_plug () +void zmq::io_object_t::set_io_thread (io_thread_t *io_thread_) { - zmq_assert (!plugged_in); - - // If termination of the object was already requested, destroy it and - // send the termination acknowledgement. - if (terminated) { - send_term_ack (owner); - delete this; - return; - } - - // Notify the generic termination mechanism (io_object_t) that the object - // is already plugged in. - plugged_in = true; + poller = io_thread_->get_poller (); } zmq::handle_t zmq::io_object_t::add_fd (fd_t fd_) @@ -106,26 +90,3 @@ void zmq::io_object_t::timer_event () { zmq_assert (false); } - -void zmq::io_object_t::term () -{ - send_term_req (owner, this); -} - -void zmq::io_object_t::process_term () -{ - zmq_assert (!terminated); - - // If termination request has occured even before the object was plugged in - // wait till plugging in happens, then acknowledge the termination. - if (!plugged_in) { - terminated = true; - return; - } - - // Otherwise, destroy the object and acknowledge the termination - // straight away. - send_term_ack (owner); - process_unplug (); - delete this; -} -- cgit v1.2.3