summaryrefslogtreecommitdiff
path: root/src/session_base.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/session_base.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/session_base.hpp')
-rw-r--r--src/session_base.hpp11
1 files changed, 4 insertions, 7 deletions
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&);
};