diff --git a/client_http.hpp b/client_http.hpp index ff7d93e..4d0571b 100644 --- a/client_http.hpp +++ b/client_http.hpp @@ -9,6 +9,7 @@ #ifdef USE_STANDALONE_ASIO #include +#include namespace SimpleWeb { using error_code = std::error_code; using errc = std::errc; @@ -18,6 +19,7 @@ namespace SimpleWeb { } // namespace SimpleWeb #else #include +#include #include namespace SimpleWeb { namespace asio = boost::asio; @@ -106,7 +108,7 @@ namespace SimpleWeb { bool in_use = false; bool attempt_reconnect = true; - std::unique_ptr timer; + std::unique_ptr timer; void set_timeout(long seconds = 0) noexcept { if(seconds == 0) @@ -115,8 +117,8 @@ namespace SimpleWeb { timer = nullptr; return; } - timer = std::unique_ptr(new asio::deadline_timer(socket->get_io_service())); - timer->expires_from_now(boost::posix_time::seconds(seconds)); + timer = std::unique_ptr(new asio::steady_timer(socket->get_io_service())); + timer->expires_from_now(std::chrono::seconds(seconds)); auto self = this->shared_from_this(); timer->async_wait([self](const error_code &ec) { if(!ec) { diff --git a/server_http.hpp b/server_http.hpp index e366818..b671bc5 100644 --- a/server_http.hpp +++ b/server_http.hpp @@ -12,7 +12,7 @@ #ifdef USE_STANDALONE_ASIO #include -#include +#include namespace SimpleWeb { using error_code = std::error_code; using errc = std::errc;