async_mqtt 9.0.1
Loading...
Searching...
No Matches
ws.hpp
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_LAYER_WS_HPP)
8#define ASYNC_MQTT_PREDEFINED_LAYER_WS_HPP
9
10#include <async_mqtt/predefined_layer/mqtt.hpp>
12
18namespace async_mqtt {
19
20namespace as = boost::asio;
21namespace bs = boost::beast;
22
23namespace protocol {
24
29using ws = bs::websocket::stream<mqtt>;
30
31} // namespace protocol
32
33
49template <
50 typename NextLayer,
51 typename CompletionToken = as::default_completion_token_t<
52 typename bs::websocket::stream<NextLayer>::executor_type
53 >
54>
55#if !defined(GENERATING_DOCUMENTATION)
56BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(
57 CompletionToken,
58 void(error_code)
59)
60#endif // !defined(GENERATING_DOCUMENTATION)
62 bs::websocket::stream<NextLayer>& layer,
63 std::string_view host,
64 std::string_view port,
65 std::string_view path,
66 CompletionToken&& token = as::default_completion_token_t<
67 typename bs::websocket::stream<NextLayer>::executor_type
68 >{}
69);
70
86template <
87 typename NextLayer,
88 typename CompletionToken = as::default_completion_token_t<
89 typename bs::websocket::stream<NextLayer>::executor_type
90 >
91>
92#if !defined(GENERATING_DOCUMENTATION)
93BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(
94 CompletionToken,
95 void(error_code)
96)
97#endif // !defined(GENERATING_DOCUMENTATION)
99 bs::websocket::stream<NextLayer>& layer,
100 std::string_view host,
101 std::string_view port,
102 CompletionToken&& token = as::default_completion_token_t<
103 typename bs::websocket::stream<NextLayer>::executor_type
104 >{}
105);
106
107} // namespace async_mqtt
108
109#include <async_mqtt/predefined_layer/impl/ws_handshake.hpp>
110
111#endif // ASYNC_MQTT_PREDEFINED_LAYER_WS_HPP
sys::error_code error_code
sys is a namespace alias of boost::sytem.
Definition error.hpp:56
async_underlying_handshake(as::basic_stream_socket< Socket, Executor > &layer, std::string_view host, std::string_view port, CompletionToken &&token=as::default_completion_token_t< Executor >{})
resovling name and connect TCP layer
bs::websocket::stream< mqtt > ws
Type alias of boost::beast::websocket::stream of mqtt.
Definition ws.hpp:29