forked from boostorg/beast
control frame callbacks are non-const references:
fix #653 Actions Required: * Modify calls to set the control frame callback, to pass non-const reference instances, and manage the lifetime of the instance.
This commit is contained in:
@@ -189,12 +189,13 @@ boost::asio::ip::tcp::socket sock{ios};
|
||||
{
|
||||
stream<boost::asio::ip::tcp::socket> ws{ios};
|
||||
//[ws_snippet_17
|
||||
ws.control_callback(
|
||||
auto cb =
|
||||
[](frame_type kind, string_view payload)
|
||||
{
|
||||
// Do something with the payload
|
||||
boost::ignore_unused(kind, payload);
|
||||
});
|
||||
};
|
||||
ws.control_callback(cb);
|
||||
//]
|
||||
|
||||
//[ws_snippet_18
|
||||
|
||||
Reference in New Issue
Block a user