diff options
author | Martin Sustrik <sustrik@250bpm.com> | 2012-02-16 10:05:01 +0900 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2012-02-16 10:05:01 +0900 |
commit | 2df873a435ff139cf9d1b10b666d75e6dc6da442 (patch) | |
tree | 042b0a349ca84919041fb37df7e5a3b7195d065d /src/pgm_sender.hpp | |
parent | b67f88a7d6322a293ac3e3be9d6df9f358509221 (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/pgm_sender.hpp')
-rw-r--r-- | src/pgm_sender.hpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/pgm_sender.hpp b/src/pgm_sender.hpp index 23c241b..000f5ba 100644 --- a/src/pgm_sender.hpp +++ b/src/pgm_sender.hpp @@ -65,17 +65,10 @@ namespace xs // i_poll_events interface implementation. void in_event (fd_t fd_); void out_event (fd_t fd_); - void timer_event (int token); + void timer_event (handle_t handle_); private: - // TX and RX timeout timer ID's. - enum {tx_timer_id = 0xa0, rx_timer_id = 0xa1}; - - // Timers are running. - bool has_tx_timer; - bool has_rx_timer; - // Message encoder. encoder_t encoder; @@ -101,6 +94,10 @@ namespace xs // If zero, there are no data to be sent. size_t write_size; + // Receive and send timers or NULL if not active. + handle_t rx_timer; + handle_t tx_timer; + pgm_sender_t (const pgm_sender_t&); const pgm_sender_t &operator = (const pgm_sender_t&); }; |