From 2cef05d86976784f4bc1083cb0fa548e267ac132 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Tue, 15 Dec 2009 17:49:40 +0100 Subject: reconnection mechanism added to tcp transport --- src/session.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'src/session.cpp') diff --git a/src/session.cpp b/src/session.cpp index 912cfa8..cbcc883 100644 --- a/src/session.cpp +++ b/src/session.cpp @@ -65,9 +65,13 @@ void zmq::session_t::flush () out_pipe->flush (); } -void zmq::session_t::detach () +void zmq::session_t::detach (owned_t *reconnecter_) { - // TODO: Start reconnection process here. + // Plug in the reconnecter object if any. + if (reconnecter_) { + send_plug (reconnecter_); + send_own (owner, reconnecter_); + } // Engine is terminating itself. No need to deallocate it from here. engine = NULL; @@ -77,6 +81,21 @@ void zmq::session_t::detach () term (); } +zmq::io_thread_t *zmq::session_t::get_io_thread () +{ + return choose_io_thread (options.affinity); +} + +class zmq::socket_base_t *zmq::session_t::get_owner () +{ + return owner; +} + +const char *zmq::session_t::get_session_name () +{ + return name.c_str (); +} + void zmq::session_t::attach_pipes (class reader_t *inpipe_, class writer_t *outpipe_) { -- cgit v1.2.3