Created
July 25, 2017 15:38
-
-
Save vinniefalco/49a7a7657e456752b68e50216b82725c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** 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 A close frame is received. In this case the error indicated by | |
the function will be @ref error::closed. | |
@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. | |
Any received message data is appended to the input area of the buffer. | |
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 read | |
incoming control frames and handle them automatically as follows: | |
@li The @ref control_callback will be invoked for each control frame. | |
@li For each received ping frame, a pong frame will be automatically sent. | |
@li If a close frame is received, the WebSocket close procedure is | |
performed. In this case, when the function returns, the error | |
@ref error::closed will be indicated. | |
@param buffer A dynamic buffer to hold the message data after | |
any masking or decompression has been applied. | |
@throws system_error Thrown to indicate an error. The corresponding | |
error code may be retrieved from the exception object for inspection. | |
*/ | |
template<class DynamicBuffer> | |
std::size_t | |
read(DynamicBuffer& buffer); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment