Improved websocket stream documentation

fix #1213
This commit is contained in:
Vinnie Falco
2019-02-08 13:26:55 -08:00
parent 44ed20aa2c
commit 168f674b4a
4 changed files with 1472 additions and 1189 deletions

View File

@ -4,6 +4,7 @@ Version 212:
* flat_stream tests and tidy
* stranded_socket tests and tidy
* buffers_front tests
* Improved websocket stream documentation
--------------------------------------------------------------------------------

View File

@ -56,17 +56,17 @@ following operations to be active at the same time:
* [link beast.ref.boost__beast__websocket__stream.async_ping `async_ping`] or [link beast.ref.boost__beast__websocket__stream.async_pong `async_pong`]
* [link beast.ref.boost__beast__websocket__stream.async_close `async_close`]
For example, the following code is malformed, because the program is
attempting to perform two simultaneous reads:
For example, the following code is produces undefined behavior, because the
program is attempting to perform two simultaneous reads:
[ws_snippet_24]
However, this code is well-formed:
However, this code is correct:
[ws_snippet_25]
The implementation uses composed asynchronous operations; although
some individiual operations can perform both reads and writes, this
some individual operations can perform both reads and writes, this
behavior is coordinated internally to make sure the underlying stream
is operated in a safe fashion. This allows an asynchronous read operation
to respond to a received ping frame even while a user-initiated call to

View File

@ -30,7 +30,16 @@ enum class status : unsigned
unknown = 0,
continue_ = 100,
/** Switching Protocols
This status indicates that a request to switch to a new
protocol was accepted and applied by the server. A successful
response to a WebSocket Upgrade HTTP request will have this
code.
*/
switching_protocols = 101,
processing = 102,
ok = 200,

File diff suppressed because it is too large Load Diff