add connect timeout logic

This commit is contained in:
KIU Shueng Chuan
2015-08-04 20:47:31 +08:00
parent c0ca2be642
commit eeb697b5ac
2 changed files with 42 additions and 4 deletions

View File

@@ -57,7 +57,7 @@ namespace zmq
private:
// ID of the timer used to delay the reconnection.
enum {reconnect_timer_id = 1};
enum {reconnect_timer_id = 1, connect_timer_id};
// Handlers for incoming commands.
void process_plug ();
@@ -71,6 +71,9 @@ namespace zmq
// Internal function to start the actual connection establishment.
void start_connecting ();
// Internal function to add a connect timer
void add_connect_timer();
// Internal function to add a reconnect timer
void add_reconnect_timer();
@@ -108,6 +111,7 @@ namespace zmq
const bool delayed_start;
// True iff a timer has been started.
bool connect_timer_started;
bool reconnect_timer_started;
// Reference to the session we belong to.