7#if !defined(ASYNC_MQTT_PREDEFINED_LAYER_CUSTOMIZED_BASIC_STREAM_HPP)
8#define ASYNC_MQTT_PREDEFINED_LAYER_CUSTOMIZED_BASIC_STREAM_HPP
10#include <boost/asio.hpp>
12#include <async_mqtt/util/stream_traits.hpp>
13#include <async_mqtt/util/log.hpp>
17namespace as = boost::asio;
33template <
typename Protocol,
typename Executor>
36 typename CompletionToken
40 as::basic_stream_socket<Protocol, Executor>& stream,
41 CompletionToken&& token
43 return as::async_compose<
47 [&stream](
auto& self) {
49 if (stream.is_open()) {
50 ASYNC_MQTT_LOG(
"mqtt_impl",
info)
55 ASYNC_MQTT_LOG(
"mqtt_impl",
info)
56 <<
"TCP already closed";
sys::error_code error_code
sys is a namespace alias of boost::sytem.
Definition error.hpp:56
@ info
info level api call is output
customization class template for underlying layer In order to adapt your layer to async_mqtt,...
Definition stream_traits.hpp:101