Read a message.
template< class DynamicBuffer> std::size_t read( DynamicBuffer& buffer, error_code& ec);
This function is used to synchronously read a complete message from the stream. The call blocks until one of the following is true:
This operation is implemented in terms of one or more calls to the next
Received message data, if any, is appended to the input area of the buffer.
websocket::stream::got_text may be used to query
the stream and determine the type of the last received message.
While this operation is active, the implementation will read incoming control frames and handle them automatically as follows:
websocket::stream::control_callback will be
invoked for each control frame.
websocket::closed will be indicated.
The number of message payload bytes appended to the buffer.
A dynamic buffer to hold the message data after any masking or decompression has been applied.
Set to indicate what error occurred, if any.