diff --git a/stream.cpp b/stream.cpp index 3a9aed3d..812ff8af 100644 --- a/stream.cpp +++ b/stream.cpp @@ -1,6 +1,13 @@ // // Created by loki on 6/5/19. // +#include +#if ((BOOST_VERSION / 1000) >= 107) +#define EXECUTOR(x) (x->get_executor()) +#else +#define EXECUTOR(x) (x->get_io_service()) +#endif + #include #include @@ -458,7 +465,7 @@ std::optional recv_peer(udp::socket &sock) { udp::endpoint peer; while (session.client_state > 0) { - asio::deadline_timer timer { sock.get_executor() }; + asio::deadline_timer timer { EXECUTOR((&sock)) }; timer.expires_from_now(boost::posix_time::seconds(2)); timer.async_wait([&](sys::error_code c){ sock.cancel();