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-02-28 13:37:50 +0300
committereidheim <eidheim@gmail.com>2020-02-28 13:37:50 +0300
commit64ac62617e809d553a902b0a7c8e3e8e308a8284 (patch)
treecefcea5022b2a4f87c45beedee9148b5f380cd31
parentc2ba9eae02806135087b9865ee4767ee738b36b4 (diff)
Updated asio_compatibility.hpp
-rw-r--r--asio_compatibility.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/asio_compatibility.hpp b/asio_compatibility.hpp
index ca332c2..a9abd7c 100644
--- a/asio_compatibility.hpp
+++ b/asio_compatibility.hpp
@@ -50,6 +50,9 @@ namespace SimpleWeb {
void async_resolve(asio::ip::tcp::resolver &resolver, const std::pair<std::string, std::string> &host_port, handler_type &&handler) {
resolver.async_resolve(host_port.first, host_port.second, std::forward<handler_type>(handler));
}
+ inline asio::executor_work_guard<io_context::executor_type> make_work_guard(io_context &context) {
+ return asio::make_work_guard(context);
+ }
#else
using io_context = asio::io_service;
using resolver_results = asio::ip::tcp::resolver::iterator;
@@ -73,6 +76,9 @@ namespace SimpleWeb {
void async_resolve(asio::ip::tcp::resolver &resolver, const std::pair<std::string, std::string> &host_port, handler_type &&handler) {
resolver.async_resolve(asio::ip::tcp::resolver::query(host_port.first, host_port.second), std::forward<handler_type>(handler));
}
+ inline io_context::work make_work_guard(io_context &context) {
+ return io_context::work(context);
+ }
#endif
} // namespace SimpleWeb