WebSocket++
0.8.3-dev
C++ websocket client/server library
|
A package of types and methods for manipulating WebSocket close status'. More...
Typedefs | |
typedef uint16_t | value |
The type of a close code value. | |
Functions | |
bool | reserved (value code) |
Test whether a close code is in a reserved range. More... | |
bool | invalid (value code) |
Test whether a close code is invalid on the wire. More... | |
bool | terminal (value code) |
Determine if the code represents an unrecoverable error. More... | |
std::string | get_string (value code) |
Return a human readable interpretation of a WebSocket close code. More... | |
Variables | |
static value const | blank = 0 |
A blank value for internal use. | |
static value const | omit_handshake = 1 |
Close the connection without a WebSocket close handshake. More... | |
static value const | force_tcp_drop = 2 |
Close the connection with a forced TCP drop. More... | |
static value const | normal = 1000 |
static value const | going_away = 1001 |
static value const | protocol_error = 1002 |
A protocol error occurred. | |
static value const | unsupported_data = 1003 |
static value const | no_status = 1005 |
A dummy value to indicate that no status code was received. More... | |
static value const | abnormal_close = 1006 |
A dummy value to indicate that the connection was closed abnormally. More... | |
static value const | invalid_payload = 1007 |
An endpoint received message data inconsistent with its type. More... | |
static value const | policy_violation = 1008 |
An endpoint received a message that violated its policy. More... | |
static value const | message_too_big = 1009 |
An endpoint received a message too large to process. | |
static value const | extension_required = 1010 |
A client expected the server to accept a required extension request. More... | |
static value const | internal_endpoint_error = 1011 |
static value const | service_restart = 1012 |
static value const | try_again_later = 1013 |
static value const | bad_gateway = 1014 |
static value const | tls_handshake = 1015 |
An endpoint failed to perform a TLS handshake. More... | |
static value const | subprotocol_error = 3000 |
A generic subprotocol error. More... | |
static value const | invalid_subprotocol_data = 3001 |
A invalid subprotocol data. More... | |
static value const | rsv_start = 1016 |
First value in range reserved for future protocol use. | |
static value const | rsv_end = 2999 |
Last value in range reserved for future protocol use. | |
static value const | invalid_low = 999 |
First value in range that is always invalid on the wire. | |
static value const | invalid_high = 5000 |
Last value in range that is always invalid on the wire. | |
A package of types and methods for manipulating WebSocket close status'.
|
inline |
Return a human readable interpretation of a WebSocket close code.
See https://tools.ietf.org/html/rfc6455#section-7.4 for more details.
[in] | code | The code to look up. |
|
inline |
|
inline |
|
inline |
Determine if the code represents an unrecoverable error.
There is a class of errors for which once they are discovered normal WebSocket functionality can no longer occur. This function determines if a given code is one of these values. This information is used to determine if the system has the capability of waiting for a close acknowledgement or if it should drop the TCP connection immediately after sending its close frame.
[in] | code | The value to test. |
|
static |
|
static |
|
static |
A client expected the server to accept a required extension request.
The list of extensions that are needed SHOULD appear in the /reason/ part of the Close frame. Note that this status code is not used by the server, because it can fail the WebSocket handshake instead.
|
static |
Close the connection with a forced TCP drop.
This special value requests that the WebSocket connection be closed by forcibly dropping the TCP connection. This will leave the other side of the connection with a broken connection and some expensive timeouts. this should not be done except in extreme cases or in cases of malicious remote endpoints.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Close the connection without a WebSocket close handshake.
This special value requests that the WebSocket connection be closed without performing the WebSocket closing handshake. This does not comply with RFC6455, but should be safe to do if necessary. This could be useful for clients that need to disconnect quickly and cannot afford the complete handshake.
|
static |
|
static |
|
static |
|
static |
An endpoint failed to perform a TLS handshake.
Designated for use in applications expecting a status code to indicate that the connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified). This value is illegal on the wire.
|
static |
|
static |