Skip to content

Commit

Permalink
Handler requirements of ping/pong are correct.
Browse files Browse the repository at this point in the history
Closes #2713
  • Loading branch information
klemens-morgenstern committed Aug 14, 2023
1 parent f9433d2 commit 7725027
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
16 changes: 8 additions & 8 deletions include/boost/beast/websocket/impl/ping.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,15 +325,15 @@ pong(ping_data const& payload, error_code& ec)
}

template<class NextLayer, bool deflateSupported>
template<BOOST_BEAST_ASYNC_TPARAM1 WriteHandler>
BOOST_BEAST_ASYNC_RESULT1(WriteHandler)
template<BOOST_BEAST_ASYNC_TPARAM1 PingHandler>
BOOST_BEAST_ASYNC_RESULT1(PingHandler)
stream<NextLayer, deflateSupported>::
async_ping(ping_data const& payload, WriteHandler&& handler)
async_ping(ping_data const& payload, PingHandler&& handler)
{
static_assert(is_async_stream<next_layer_type>::value,
"AsyncStream type requirements not met");
return net::async_initiate<
WriteHandler,
PingHandler,
void(error_code)>(
run_ping_op{},
handler,
Expand All @@ -343,15 +343,15 @@ async_ping(ping_data const& payload, WriteHandler&& handler)
}

template<class NextLayer, bool deflateSupported>
template<BOOST_BEAST_ASYNC_TPARAM1 WriteHandler>
BOOST_BEAST_ASYNC_RESULT1(WriteHandler)
template<BOOST_BEAST_ASYNC_TPARAM1 PongHandler>
BOOST_BEAST_ASYNC_RESULT1(PongHandler)
stream<NextLayer, deflateSupported>::
async_pong(ping_data const& payload, WriteHandler&& handler)
async_pong(ping_data const& payload, PongHandler&& handler)
{
static_assert(is_async_stream<next_layer_type>::value,
"AsyncStream type requirements not met");
return net::async_initiate<
WriteHandler,
PongHandler,
void(error_code)>(
run_ping_op{},
handler,
Expand Down
12 changes: 6 additions & 6 deletions include/boost/beast/websocket/stream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1762,13 +1762,13 @@ class stream
so that only closing it is guaranteed to succeed.
*/
template<
BOOST_BEAST_ASYNC_TPARAM1 WriteHandler =
BOOST_BEAST_ASYNC_TPARAM1 PingHandler =
net::default_completion_token_t<executor_type>
>
BOOST_BEAST_ASYNC_RESULT1(WriteHandler)
BOOST_BEAST_ASYNC_RESULT1(PingHandler)
async_ping(
ping_data const& payload,
WriteHandler&& handler =
PingHandler&& handler =
net::default_completion_token_t<
executor_type>{});

Expand Down Expand Up @@ -1885,13 +1885,13 @@ class stream
so that only closing it is guaranteed to succeed.
*/
template<
BOOST_BEAST_ASYNC_TPARAM1 WriteHandler =
BOOST_BEAST_ASYNC_TPARAM1 PongHandler =
net::default_completion_token_t<executor_type>
>
BOOST_BEAST_ASYNC_RESULT1(WriteHandler)
BOOST_BEAST_ASYNC_RESULT1(PongHandler)
async_pong(
ping_data const& payload,
WriteHandler&& handler =
PongHandler&& handler =
net::default_completion_token_t<
executor_type>{});

Expand Down

0 comments on commit 7725027

Please sign in to comment.