New asio: removed use of strand, and fixed steady_timer constructor call

This commit is contained in:
eidheim 2019-05-22 11:50:18 +00:00 committed by eidheim
commit 1b5f062678
3 changed files with 32 additions and 42 deletions

View file

@ -99,7 +99,7 @@ namespace SimpleWeb {
timer = nullptr;
return;
}
timer = std::unique_ptr<asio::steady_timer>(new asio::steady_timer(get_socket_context(*socket), std::chrono::seconds(seconds)));
timer = std::unique_ptr<asio::steady_timer>(new asio::steady_timer(get_socket_executor(*socket), std::chrono::seconds(seconds)));
auto self = this->shared_from_this();
timer->async_wait([self](const error_code &ec) {
if(!ec) {