Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/Simple-WebSocket-Server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreidheim <eidheim@gmail.com>2020-08-26 12:45:30 +0300
committereidheim <eidheim@gmail.com>2020-08-26 12:45:30 +0300
commita7b227bdbed7ec2e74565772d63e61ae11106d56 (patch)
treeb56ae4ee7574e91c31f9923a6aca19507014c769 /asio_compatibility.hpp
parent84ebe12828cfe2508dce0c523fab3c867741e602 (diff)
Fixed compilation issues for older (boost.)asio versions
Diffstat (limited to 'asio_compatibility.hpp')
-rw-r--r--asio_compatibility.hpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/asio_compatibility.hpp b/asio_compatibility.hpp
index 3d2df07..c2e0b66 100644
--- a/asio_compatibility.hpp
+++ b/asio_compatibility.hpp
@@ -43,8 +43,8 @@ namespace SimpleWeb {
return asio::ip::make_address(str);
}
template <typename socket_type, typename duration_type>
- asio::steady_timer make_steady_timer(socket_type &socket, std::chrono::duration<duration_type> duration) {
- return asio::steady_timer(socket.get_executor(), duration);
+ std::unique_ptr<asio::steady_timer> make_steady_timer(socket_type &socket, std::chrono::duration<duration_type> duration) {
+ return std::unique_ptr<asio::steady_timer>(new asio::steady_timer(socket.get_executor(), duration));
}
template <typename handler_type>
void async_resolve(asio::ip::tcp::resolver &resolver, const std::pair<std::string, std::string> &host_port, handler_type &&handler) {
@@ -68,9 +68,9 @@ namespace SimpleWeb {
inline asio::ip::address make_address(const std::string &str) noexcept {
return asio::ip::address::from_string(str);
}
- template <typename socket_type>
- io_context &get_socket_executor(socket_type &socket) {
- return socket.get_io_service();
+ template <typename socket_type, typename duration_type>
+ std::unique_ptr<asio::steady_timer> make_steady_timer(socket_type &socket, std::chrono::duration<duration_type> duration) {
+ return std::unique_ptr<asio::steady_timer>(new asio::steady_timer(socket.get_io_service(), duration));
}
template <typename handler_type>
void async_resolve(asio::ip::tcp::resolver &resolver, const std::pair<std::string, std::string> &host_port, handler_type &&handler) {