Hi,
As you can see to on_time_out() is called immediately after
expires_from_now() call,
with no actual time out.
How do I restart to timer in the right way?
You could check error code in handler, in case of cancellation (including settings new expiration time) it contains the value boost::asio::error::operation_aborted.
Best Regards,
Sergei