async_mqtt 5.0.0
Loading...
Searching...
No Matches
predefined_underlying_layer.hpp
Go to the documentation of this file.
1// Copyright Takatoshi Kondo 2022
2//
3// Distributed under the Boost Software License, Version 1.0.
4// (See accompanying file LICENSE_1_0.txt or copy at
5// http://www.boost.org/LICENSE_1_0.txt)
6
7#if !defined(ASYNC_MQTT_PREDEFINED_UNDERLYING_LAYER_HPP)
8#define ASYNC_MQTT_PREDEFINED_UNDERLYING_LAYER_HPP
9
10#include <boost/asio/ip/tcp.hpp>
11#include <boost/beast/websocket/stream.hpp>
12
13#include <async_mqtt/tls.hpp>
14
16
17namespace async_mqtt {
18
19namespace as = boost::asio;
20namespace bs = boost::beast;
21
22namespace protocol {
23
27using mqtt = as::basic_stream_socket<as::ip::tcp, as::any_io_executor>;
28
29#if defined(ASYNC_MQTT_USE_WS)
30
31namespace detail {
32
33using mqtt_beast_workaround = as::basic_stream_socket<as::ip::tcp, as::io_context::executor_type>;
34
35} // namespace detail
36
40using ws = bs::websocket::stream<detail::mqtt_beast_workaround>;
41#endif //defined(ASYNC_MQTT_USE_WS)
42
43} // namespace procotol
44
45} // namespace async_mqtt
46
47#if defined(ASYNC_MQTT_USE_TLS)
48
49namespace async_mqtt {
50
51namespace protocol {
52
56using mqtts = tls::stream<mqtt>;
57
58#if defined(ASYNC_MQTT_USE_WS)
59
60namespace detail {
61
62using mqtts_beast_workaround = tls::stream<mqtt_beast_workaround>;
63
64} // namespace detail
65
69using wss = bs::websocket::stream<detail::mqtts_beast_workaround>;
70#endif // defined(ASYNC_MQTT_USE_WS)
71
72
73} // namespace procotol
74
75} // namespace async_mqtt
76
77#endif // defined(ASYNC_MQTT_USE_TLS)
78
79#endif // ASYNC_MQTT_PREDEFINED_UNDERLYING_LAYER_HPP
bs::websocket::stream< detail::mqtts_beast_workaround > wss
Definition predefined_underlying_layer.hpp:69
bs::websocket::stream< detail::mqtt_beast_workaround > ws
Definition predefined_underlying_layer.hpp:40
tls::stream< mqtt > mqtts
Definition predefined_underlying_layer.hpp:56
as::basic_stream_socket< as::ip::tcp, as::any_io_executor > mqtt
Definition predefined_underlying_layer.hpp:27