mirror of
https://github.com/boostorg/mqtt5.git
synced 2025-07-29 20:17:37 +02:00
fix for default completion tokens on Boost 1.87.0
Reviewers: ivica Reviewed By: ivica Subscribers: korina, miljen Differential Revision: https://repo.mireo.local/D33181
This commit is contained in:
@ -111,7 +111,7 @@ public:
|
||||
}
|
||||
|
||||
void operator()(std::array<std::size_t, 3> /* ord */) {
|
||||
_handler.complete(asio::error::operation_aborted);
|
||||
_handler.complete(make_error_code(asio::error::operation_aborted));
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -66,7 +66,8 @@ public:
|
||||
/// The client type when rebound to the specified executor.
|
||||
using other = mqtt_client<
|
||||
typename detail::rebind_executor<StreamType, Executor>::other,
|
||||
TlsContext
|
||||
TlsContext,
|
||||
LoggerType
|
||||
>;
|
||||
};
|
||||
|
||||
|
@ -46,16 +46,20 @@ namespace test {
|
||||
|
||||
// the following code needs to compile
|
||||
|
||||
template <typename StreamType, typename TlsContextType = std::monostate>
|
||||
template <
|
||||
typename StreamType,
|
||||
typename TlsContextType = std::monostate,
|
||||
typename Logger = noop_logger
|
||||
>
|
||||
asio::awaitable<void> test_default_completion_tokens_impl(
|
||||
TlsContextType tls_context = {}
|
||||
TlsContextType tls_context = {}, Logger logger = {}
|
||||
) {
|
||||
asio::io_context ioc;
|
||||
|
||||
using client_type = asio::use_awaitable_t<>::as_default_on_t<
|
||||
mqtt_client<StreamType, TlsContextType>
|
||||
mqtt_client<StreamType, TlsContextType, Logger>
|
||||
>;
|
||||
client_type c(ioc, std::move(tls_context));
|
||||
client_type c(ioc, std::move(tls_context), std::move(logger));
|
||||
|
||||
co_await c.async_run();
|
||||
|
||||
@ -96,8 +100,12 @@ asio::awaitable<void> test_default_completion_tokens() {
|
||||
|
||||
co_await test_default_completion_tokens_impl<
|
||||
boost::beast::websocket::stream<asio::ssl::stream<asio::ip::tcp::socket>>,
|
||||
asio::ssl::context
|
||||
>(asio::ssl::context(asio::ssl::context::tls_client));
|
||||
asio::ssl::context,
|
||||
logger
|
||||
>(
|
||||
asio::ssl::context(asio::ssl::context::tls_client),
|
||||
logger(log_level::debug)
|
||||
);
|
||||
}
|
||||
|
||||
} // end namespace test
|
||||
|
Reference in New Issue
Block a user