You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
endpoint::set_timer creates a new boost::asio::deadline_timer. The actual duration that this timer waits changes if the system clock changes. Typically, timeouts related to networking should be independent of changes to the system clock. To achieve independence, use steady_timer instead. See the Boost Clocks documentation for background.
The text was updated successfully, but these errors were encountered:
This is a good point. Unfortunately using steady_timer in practice is a bit more complicated. The clock type required does not exist until C++11 and Boost 1.47. The timer type does not exist until Boost 1.49 which is not easily available in many LTS Linux distributions yet. Secondly, many C++11 standard libraries either implement steady_clock as a non-monotonic clock or require extra care when compiling the end user application to actually get the right clocks enabled.
Where it is supported, the steady_clock based timer is definitely the best choice here though. I'll look into options for switching between the two. The Asio transport policy already includes a method to allow this sort of customization so it shouldn't be too difficult.
endpoint::set_timer
creates a newboost::asio::deadline_timer
. The actual duration that this timer waits changes if the system clock changes. Typically, timeouts related to networking should be independent of changes to the system clock. To achieve independence, usesteady_timer
instead. See the Boost Clocks documentation for background.The text was updated successfully, but these errors were encountered: