summaryrefslogtreecommitdiff
path: root/src/tcp_connecter.hpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2012-02-16 10:05:01 +0900
committerMartin Sustrik <sustrik@250bpm.com>2012-02-16 10:05:01 +0900
commit2df873a435ff139cf9d1b10b666d75e6dc6da442 (patch)
tree042b0a349ca84919041fb37df7e5a3b7195d065d /src/tcp_connecter.hpp
parentb67f88a7d6322a293ac3e3be9d6df9f358509221 (diff)
Timers identified by dynamically generated handles
Timers are not longer identified by hard-wired IDs. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/tcp_connecter.hpp')
-rw-r--r--src/tcp_connecter.hpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tcp_connecter.hpp b/src/tcp_connecter.hpp
index 5791422..b86c2d5 100644
--- a/src/tcp_connecter.hpp
+++ b/src/tcp_connecter.hpp
@@ -47,16 +47,13 @@ namespace xs
private:
- // ID of the timer used to delay the reconnection.
- enum {reconnect_timer_id = 1};
-
// Handlers for incoming commands.
void process_plug ();
// Handlers for I/O events.
void in_event (fd_t fd_);
void out_event (fd_t fd_);
- void timer_event (int id_);
+ void timer_event (handle_t handle_);
// Internal function to start the actual connection establishment.
void start_connecting ();
@@ -109,6 +106,9 @@ namespace xs
// Current reconnect ivl, updated for backoff strategy
int current_reconnect_ivl;
+ // Handle to reconnect timer, if active, NULL otherwise.
+ handle_t reconnect_timer;
+
tcp_connecter_t (const tcp_connecter_t&);
const tcp_connecter_t &operator = (const tcp_connecter_t&);
};