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:
Vinnie Falco
2017-06-24 12:11:46 -07:00
parent 44824a4166
commit e7b01dc5c4
7 changed files with 110 additions and 60 deletions

View File

@@ -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);
});
//]