New asio api: removed unnecessary SimpleWeb::timer_expires_after

This commit is contained in:
eidheim 2019-05-20 18:39:54 +02:00
commit 44c2f733dc
3 changed files with 3 additions and 19 deletions

View file

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