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/zmq_connecter.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/zmq_connecter.cpp') diff --git a/src/zmq_connecter.cpp b/src/zmq_connecter.cpp index 8d5c59f..cd7d1b5 100644 --- a/src/zmq_connecter.cpp +++ b/src/zmq_connecter.cpp @@ -38,9 +38,13 @@ zmq::zmq_connecter_t::~zmq_connecter_t () { } -int zmq::zmq_connecter_t::set_address (const char *addr_) +int zmq::zmq_connecter_t::set_address (const char *address_) { - return tcp_connecter.set_address (addr_); + int rc = tcp_connecter.set_address (address_); + if (rc != 0) + return rc; + address = address_; + return 0; } void zmq::zmq_connecter_t::process_plug () @@ -84,7 +88,7 @@ void zmq::zmq_connecter_t::out_event () // Create an init object. io_thread_t *io_thread = choose_io_thread (options.affinity); zmq_connecter_init_t *init = new zmq_connecter_init_t (io_thread, owner, - fd, options, session_name.c_str ()); + fd, options, session_name.c_str (), address.c_str ()); zmq_assert (init); send_plug (init); send_own (owner, init); -- cgit v1.2.3