forked from boostorg/beast
control_callback replaces ping_callback (API Change):
fix #322 The new callback is informed of all frame types including close. Actions Required: * Change calls to websocket::stream::ping_callback to use websocket::stream::control_callback * Change user defined ping callbacks to have the new signature and adjust the callback definition appropriately.
This commit is contained in:
@@ -187,11 +187,11 @@ boost::asio::ip::tcp::socket sock{ios};
|
||||
{
|
||||
stream<boost::asio::ip::tcp::socket> ws{ios};
|
||||
//[ws_snippet_17
|
||||
ws.ping_callback(
|
||||
[](bool is_pong, ping_data const& payload)
|
||||
ws.control_callback(
|
||||
[](frame_type kind, string_view payload)
|
||||
{
|
||||
// Do something with the payload
|
||||
boost::ignore_unused(is_pong, payload);
|
||||
boost::ignore_unused(kind, payload);
|
||||
});
|
||||
//]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user