From 2df873a435ff139cf9d1b10b666d75e6dc6da442 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Thu, 16 Feb 2012 10:05:01 +0900 Subject: Timers identified by dynamically generated handles Timers are not longer identified by hard-wired IDs. Signed-off-by: Martin Sustrik --- src/session_base.hpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/session_base.hpp') diff --git a/src/session_base.hpp b/src/session_base.hpp index 2360b6b..45ad8f8 100644 --- a/src/session_base.hpp +++ b/src/session_base.hpp @@ -84,7 +84,7 @@ namespace xs void process_term (int linger_); // i_poll_events handlers. - void timer_event (int id_); + void timer_event (handle_t handle_); // Remove any half processed messages. Flush unflushed messages. // Call this function when engine disconnect to get rid of leftovers. @@ -118,12 +118,6 @@ namespace xs // the engines into the same thread. xs::io_thread_t *io_thread; - // ID of the linger timer - enum {linger_timer_id = 0x20}; - - // True is linger timer is running. - bool has_linger_timer; - // If true, identity is to be sent/recvd from the network. bool send_identity; bool recv_identity; @@ -132,6 +126,9 @@ namespace xs std::string protocol; std::string address; + // Handle of the linger timer, if active, NULL otherwise. + handle_t linger_timer; + session_base_t (const session_base_t&); const session_base_t &operator = (const session_base_t&); }; -- cgit v1.2.3