Advertisement
Guest User

Untitled

a guest
Jul 25th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. /** Read a complete message
  2.  
  3. This function is used to synchronously read a message from the stream.
  4. The call blocks until one of the following is true:
  5.  
  6. @li A complete message is received.
  7.  
  8. @li A close frame is received. In this case the error indicated by
  9. the function will be @ref error::closed.
  10.  
  11. @li An error occurs on the stream.
  12.  
  13. This operation is implemented in terms of one or more calls to the next
  14. layer's `read_some` and `write_some` functions.
  15.  
  16. Any received message data is appended to the input area of the buffer.
  17. The functions @ref got_binary and @ref got_text may be used to query
  18. the stream and determine the type of the last received message.
  19.  
  20. While this read operation is active, the implementation will read
  21. incoming control frames and handle them automatically as follows:
  22.  
  23. @li The @ref control_callback will be invoked for each control frame.
  24.  
  25. @li For each received ping frame, a pong frame will be automatically sent.
  26.  
  27. @li If a close frame is received, the WebSocket close procedure is
  28. performed. In this case, when the function returns, the error
  29. @ref error::closed will be indicated.
  30.  
  31. @param buffer A dynamic buffer to hold the message data after
  32. any masking or decompression has been applied.
  33.  
  34. @throws system_error Thrown to indicate an error. The corresponding
  35. error code may be retrieved from the exception object for inspection.
  36. */
  37. template<class DynamicBuffer>
  38. std::size_t
  39. read(DynamicBuffer& buffer);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement