File tree Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 20
20
namespace boost {
21
21
namespace ws_io {
22
22
23
+ struct null_decorator
24
+ {
25
+ void operator ()(...) const noexcept
26
+ {
27
+ }
28
+ };
29
+
23
30
/* * A websocket client session
24
31
*/
25
32
template <
@@ -41,16 +48,19 @@ class client
41
48
BOOST_ASIO_COMPLETION_TOKEN_FOR (void (
42
49
::boost::beast::error_code,
43
50
::boost::http_proto::response_view)) HandshakeHandler =
44
- asio::default_completion_token_t <executor_type>
51
+ asio::default_completion_token_t <executor_type>,
52
+ class Decorator = null_decorator
45
53
>
46
54
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE (HandshakeHandler, void (
47
55
::boost::beast::error_code,
48
56
::boost::http_proto::response_view))
49
57
async_handshake (
50
58
core::string_view host,
51
59
core::string_view target,
60
+ Decorator decorator = {},
52
61
HandshakeHandler&& handler =
53
- asio::default_completion_token_t <executor_type>{});
62
+ asio::default_completion_token_t <executor_type>{}
63
+ );
54
64
55
65
AsyncStream&
56
66
next_layer () noexcept
Original file line number Diff line number Diff line change @@ -94,14 +94,16 @@ template<class AsyncStream>
94
94
template <
95
95
BOOST_ASIO_COMPLETION_TOKEN_FOR (void (
96
96
::boost::beast::error_code,
97
- ::boost::http_proto::response_view)) HandshakeHandler>
97
+ ::boost::http_proto::response_view)) HandshakeHandler,
98
+ class Decorator >
98
99
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE (HandshakeHandler, void (
99
100
::boost::beast::error_code,
100
101
::boost::http_proto::response_view))
101
102
client<AsyncStream>::
102
103
async_handshake (
103
104
core::string_view host,
104
105
core::string_view target,
106
+ Decorator decorator,
105
107
HandshakeHandler&& handler)
106
108
{
107
109
return asio::async_initiate<
Original file line number Diff line number Diff line change @@ -31,8 +31,11 @@ struct client_test
31
31
cs.async_handshake (
32
32
" localhost" ,
33
33
" /" ,
34
+ [](http_proto::request&)
35
+ {
36
+ },
34
37
test::success_handler ());
35
- srv.run ();
38
+ // srv.run();
36
39
}
37
40
};
38
41
You can’t perform that action at this time.
0 commit comments