summaryrefslogtreecommitdiff
path: root/src/zmq_connecter_init.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@fastmq.commkdir>2009-09-16 11:02:18 +0200
committerMartin Sustrik <sustrik@fastmq.commkdir>2009-09-16 11:02:18 +0200
commit9c522dccaf0b2c8074bd96fbfb4c968f45748ba4 (patch)
treedc57d84016ab8b0d1abbd5291bde434d985ab48a /src/zmq_connecter_init.cpp
parent6e03cb2f3eb083e1de8e7161d3ab21b52c87eece (diff)
reconnect added to zmq_connecter
Diffstat (limited to 'src/zmq_connecter_init.cpp')
-rw-r--r--src/zmq_connecter_init.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/zmq_connecter_init.cpp b/src/zmq_connecter_init.cpp
index 730077a..ffd4a64 100644
--- a/src/zmq_connecter_init.cpp
+++ b/src/zmq_connecter_init.cpp
@@ -18,6 +18,7 @@
*/
#include "zmq_connecter_init.hpp"
+#include "zmq_connecter.hpp"
#include "io_thread.hpp"
#include "session.hpp"
#include "err.hpp"
@@ -83,8 +84,25 @@ void zmq::zmq_connecter_init_t::flush ()
void zmq::zmq_connecter_init_t::detach ()
{
- // TODO: Engine is closing down. Init object is to be closed as well.
- zmq_assert (false);
+ // TODO: Start reconnection process here.
+/*
+ // Create a connecter object to attempt reconnect. Ask it to wait for a
+ // while before reconnecting.
+ io_thread_t *io_thread = choose_io_thread (options.affinity);
+ zmq_connecter_t *connecter = new zmq_connecter_t (io_thread, owner,
+ options, session_name.c_str (), true);
+ connecter->set_address (...);
+ zmq_assert (connecter);
+ send_plug (connecter);
+ send_own (owner, connecter);
+*/
+
+ // This function is called by engine when disconnection occurs.
+ // The engine will destroy itself, so we just drop the pointer here and
+ // start termination of the init object.
+ engine = NULL;
+ term ();
+
}
void zmq::zmq_connecter_init_t::process_plug ()