[Boost-bugs] [Boost C++ Libraries] #3504: deadline_timer (based on UTC time) is not suitable for communication timeouts

Subject: [Boost-bugs] [Boost C++ Libraries] #3504: deadline_timer (based on UTC time) is not suitable for communication timeouts
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-10-02 07:36:59


#3504: deadline_timer (based on UTC time) is not suitable for communication
timeouts
-------------------------------------------+--------------------------------
 Reporter: Bjarne Laursen <bla@…> | Owner: chris_kohlhoff
     Type: Feature Requests | Status: new
Milestone: Boost 1.41.0 | Component: asio
  Version: Boost 1.38.0 | Severity: Problem
 Keywords: |
-------------------------------------------+--------------------------------
 If you use the deadline_timer to make a polling every 10th second, it will
 be heavely affected if someone adjust the system clock with date command,
 or if the time is adjusted automaticly by NTP.

 Uses as this should use a timer that cannot make jumps like that.

 I solved this by making a new time_traits called monotone_time. It uses
 GetTickCount() for windows and clock_gettime(CLOCK_MONOTONIC, ...) for
 linux. See attachment.

 To use it your timer must be a monotone_timer instead of a deadline_timer.
 You can use both types of timers in you application.

 I hope this can be a part of a future release of boost::asio

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3504>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:01 UTC