read_frame returns bool fin (API Change):

* frame_info struct is removed

* read_frame and async_read_frame return a bool indicating
  if the frame is the last frame of the current message.

Actions Required:

* Remove the frame_info parameter from all read frame call sites

* Check the return value 'fin' for calls to read_frame

* Change ReadHandlers passed to async_read_frame to have
  the signature void(error_code, bool fin), use the bool
  to indicate if the frame is the last frame.
This commit is contained in:
Vinnie Falco
2017-06-08 20:34:27 -07:00
parent 620ce08d6a
commit 9e910761cc
4 changed files with 92 additions and 147 deletions

View File

@@ -163,14 +163,10 @@ boost::asio::ip::tcp::socket sock{ios};
stream<boost::asio::ip::tcp::socket> ws{ios};
//[ws_snippet_16
multi_buffer buffer;
frame_info fi;
for(;;)
{
ws.read_frame(fi, buffer);
if(fi.fin)
if(ws.read_frame(buffer))
break;
}
ws.binary(fi.op == opcode::binary);
ws.binary(ws.got_binary());
consuming_buffers<multi_buffer::const_buffers_type> cb{buffer.data()};
for(;;)
{