From a8a8b62c0426d37aba09cf689d1efd58ed873842 Mon Sep 17 00:00:00 2001 From: bugdea1er Date: Mon, 6 Jan 2025 21:58:28 +0300 Subject: [PATCH] Rename `get_io_service` methods --- include/crow/http_connection.h | 2 +- include/crow/socket_adaptors.h | 12 ++++++------ include/crow/websocket.h | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/crow/http_connection.h b/include/crow/http_connection.h index b5d02f879..04909453e 100644 --- a/include/crow/http_connection.h +++ b/include/crow/http_connection.h @@ -143,7 +143,7 @@ namespace crow ctx_ = detail::context(); req_.middleware_context = static_cast(&ctx_); req_.middleware_container = static_cast(middlewares_); - req_.io_context = &adaptor_.get_io_service(); + req_.io_context = &adaptor_.get_io_context(); req_.remote_ip_address = adaptor_.remote_endpoint().address().to_string(); diff --git a/include/crow/socket_adaptors.h b/include/crow/socket_adaptors.h index 2b7cae0d8..076e4ad05 100644 --- a/include/crow/socket_adaptors.h +++ b/include/crow/socket_adaptors.h @@ -19,9 +19,9 @@ #include "crow/settings.h" #if (CROW_USE_BOOST && BOOST_VERSION >= 107000) || (ASIO_VERSION >= 101300) -#define GET_IO_SERVICE(s) ((asio::io_context&)(s).get_executor().context()) +#define GET_IO_CONTEXT(s) ((asio::io_context&)(s).get_executor().context()) #else -#define GET_IO_SERVICE(s) ((s).get_io_service()) +#define GET_IO_CONTEXT(s) ((s).get_io_service()) #endif namespace crow @@ -42,9 +42,9 @@ namespace crow socket_(io_context) {} - asio::io_context& get_io_service() + asio::io_context& get_io_context() { - return GET_IO_SERVICE(socket_); + return GET_IO_CONTEXT(socket_); } /// Get the TCP socket handling data trasfers, regardless of what layer is handling transfers on top of the socket. @@ -168,9 +168,9 @@ namespace crow } } - asio::io_context& get_io_service() + asio::io_context& get_io_context() { - return GET_IO_SERVICE(raw_socket()); + return GET_IO_CONTEXT(raw_socket()); } template diff --git a/include/crow/websocket.h b/include/crow/websocket.h index 8e5bd8731..fa5e18546 100644 --- a/include/crow/websocket.h +++ b/include/crow/websocket.h @@ -202,7 +202,7 @@ namespace crow // NOTE: Already documented in "crow/app.h" template void dispatch(CompletionHandler&& handler) { - asio::dispatch(adaptor_.get_io_service(), + asio::dispatch(adaptor_.get_io_context(), WeakWrappedMessage::type>{ std::forward(handler), anchor_}); } @@ -211,7 +211,7 @@ namespace crow // NOTE: Already documented in "crow/app.h" template void post(CompletionHandler&& handler) { - asio::post(adaptor_.get_io_service(), + asio::post(adaptor_.get_io_context(), WeakWrappedMessage::type>{ std::forward(handler), anchor_}); }