Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vinniefalco/d6d0b54d1c8987228b86df213c6bc6b0 to your computer and use it in GitHub Desktop.
Save vinniefalco/d6d0b54d1c8987228b86df213c6bc6b0 to your computer and use it in GitHub Desktop.
/** Read a complete message
This function is used to synchronously read a message from the stream.
The call blocks until one of the following is true:
@li A complete message is received.
@li An error occurs on the stream.
This operation is implemented in terms of one or more calls to the next
layer's `read_some` and `write_some` functions.
All received message data, if any, is appended to the input area.
The functions @ref got_binary and @ref got_text may be used to
query the stream and determine the type of the last received message.
While this read operation is active, the implementation will handle
received control frames automatically as follows:
@li All received control frames will invoke the @ref control_callback.
@li If a ping frame is received, a pong frame will be automatically sent.
@li If a close frame is received, the WebSocket close procedure is
performed. In this case, the function will eventually return
with the error set to @ref error::closed.
@param buffer A dynamic buffer to hold the message data after
any masking or decompression has been applied.
@throws system_error Thrown on failure.
*/
template<class DynamicBuffer>
void
read(DynamicBuffer& buffer);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment