mirror of
https://github.com/boostorg/beast.git
synced 2025-07-30 21:07:26 +02:00
@ -5,6 +5,10 @@ Version 41
|
|||||||
* Remove coveralls integration
|
* Remove coveralls integration
|
||||||
* Tidy up formal parameter names
|
* Tidy up formal parameter names
|
||||||
|
|
||||||
|
WebSocket
|
||||||
|
|
||||||
|
* Tidy up websocket::close_code enum and constructors
|
||||||
|
|
||||||
API Changes
|
API Changes
|
||||||
|
|
||||||
* Return http::error::end_of_stream on HTTP read eof
|
* Return http::error::end_of_stream on HTTP read eof
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
#include <beast/config.hpp>
|
#include <beast/config.hpp>
|
||||||
#include <beast/core/static_string.hpp>
|
#include <beast/core/static_string.hpp>
|
||||||
|
#include <beast/core/string_view.hpp>
|
||||||
#include <beast/http/message.hpp>
|
#include <beast/http/message.hpp>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@ -79,9 +80,8 @@ enum class opcode : std::uint8_t
|
|||||||
These codes accompany close frames.
|
These codes accompany close frames.
|
||||||
|
|
||||||
@see <a href="https://tools.ietf.org/html/rfc6455#section-7.4.1">RFC 6455 7.4.1 Defined Status Codes</a>
|
@see <a href="https://tools.ietf.org/html/rfc6455#section-7.4.1">RFC 6455 7.4.1 Defined Status Codes</a>
|
||||||
|
|
||||||
*/
|
*/
|
||||||
enum close_code
|
enum close_code : std::uint16_t
|
||||||
{
|
{
|
||||||
/// Normal closure; the connection successfully completed whatever purpose for which it was created.
|
/// Normal closure; the connection successfully completed whatever purpose for which it was created.
|
||||||
normal = 1000,
|
normal = 1000,
|
||||||
@ -195,20 +195,24 @@ struct close_reason
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Construct from a reason. code is close_code::normal.
|
/// Construct from a reason string. code is @ref close_code::normal.
|
||||||
template<std::size_t N>
|
close_reason(string_view s)
|
||||||
close_reason(char const (&reason_)[N])
|
|
||||||
: code(close_code::normal)
|
: code(close_code::normal)
|
||||||
, reason(reason_)
|
, reason(s)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Construct from a code and reason.
|
/// Construct from a reason string literal. code is @ref close_code::normal.
|
||||||
template<std::size_t N>
|
close_reason(char const* s)
|
||||||
close_reason(close_code code_,
|
: code(close_code::normal)
|
||||||
char const (&reason_)[N])
|
, reason(s)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Construct from a close code and reason string.
|
||||||
|
close_reason(close_code code_, string_view s)
|
||||||
: code(code_)
|
: code(code_)
|
||||||
, reason(reason_)
|
, reason(s)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user