Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /** 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);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement