Skip to content

Commit a8a8b62

Browse files
committed
Rename get_io_service methods
1 parent f76833b commit a8a8b62

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

include/crow/http_connection.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ namespace crow
143143
ctx_ = detail::context<Middlewares...>();
144144
req_.middleware_context = static_cast<void*>(&ctx_);
145145
req_.middleware_container = static_cast<void*>(middlewares_);
146-
req_.io_context = &adaptor_.get_io_service();
146+
req_.io_context = &adaptor_.get_io_context();
147147

148148
req_.remote_ip_address = adaptor_.remote_endpoint().address().to_string();
149149

include/crow/socket_adaptors.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
#include "crow/settings.h"
2020

2121
#if (CROW_USE_BOOST && BOOST_VERSION >= 107000) || (ASIO_VERSION >= 101300)
22-
#define GET_IO_SERVICE(s) ((asio::io_context&)(s).get_executor().context())
22+
#define GET_IO_CONTEXT(s) ((asio::io_context&)(s).get_executor().context())
2323
#else
24-
#define GET_IO_SERVICE(s) ((s).get_io_service())
24+
#define GET_IO_CONTEXT(s) ((s).get_io_service())
2525
#endif
2626

2727
namespace crow
@@ -42,9 +42,9 @@ namespace crow
4242
socket_(io_context)
4343
{}
4444

45-
asio::io_context& get_io_service()
45+
asio::io_context& get_io_context()
4646
{
47-
return GET_IO_SERVICE(socket_);
47+
return GET_IO_CONTEXT(socket_);
4848
}
4949

5050
/// 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
168168
}
169169
}
170170

171-
asio::io_context& get_io_service()
171+
asio::io_context& get_io_context()
172172
{
173-
return GET_IO_SERVICE(raw_socket());
173+
return GET_IO_CONTEXT(raw_socket());
174174
}
175175

176176
template<typename F>

include/crow/websocket.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ namespace crow // NOTE: Already documented in "crow/app.h"
202202
template<typename CompletionHandler>
203203
void dispatch(CompletionHandler&& handler)
204204
{
205-
asio::dispatch(adaptor_.get_io_service(),
205+
asio::dispatch(adaptor_.get_io_context(),
206206
WeakWrappedMessage<typename std::decay<CompletionHandler>::type>{
207207
std::forward<CompletionHandler>(handler), anchor_});
208208
}
@@ -211,7 +211,7 @@ namespace crow // NOTE: Already documented in "crow/app.h"
211211
template<typename CompletionHandler>
212212
void post(CompletionHandler&& handler)
213213
{
214-
asio::post(adaptor_.get_io_service(),
214+
asio::post(adaptor_.get_io_context(),
215215
WeakWrappedMessage<typename std::decay<CompletionHandler>::type>{
216216
std::forward<CompletionHandler>(handler), anchor_});
217217
}

0 commit comments

Comments
 (0)