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:
Vinnie Falco
2017-07-28 17:07:25 -07:00
parent 629872b28f
commit e15448a83a
4 changed files with 82 additions and 50 deletions
+3 -2
View File
@@ -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