WEB_SOCKET_CLOSE_STATUS enumeration (websocket.h)

The WEB_SOCKET_CLOSE_STATUS enumeration specifies the WebSocket close status as defined by WSPROTO.

Syntax

typedef enum _WEB_SOCKET_CLOSE_STATUS {
  WEB_SOCKET_SUCCESS_CLOSE_STATUS = 1000,
  WEB_SOCKET_ENDPOINT_UNAVAILABLE_CLOSE_STATUS = 1001,
  WEB_SOCKET_PROTOCOL_ERROR_CLOSE_STATUS = 1002,
  WEB_SOCKET_INVALID_DATA_TYPE_CLOSE_STATUS = 1003,
  WEB_SOCKET_EMPTY_CLOSE_STATUS = 1005,
  WEB_SOCKET_ABORTED_CLOSE_STATUS = 1006,
  WEB_SOCKET_INVALID_PAYLOAD_CLOSE_STATUS = 1007,
  WEB_SOCKET_POLICY_VIOLATION_CLOSE_STATUS = 1008,
  WEB_SOCKET_MESSAGE_TOO_BIG_CLOSE_STATUS = 1009,
  WEB_SOCKET_UNSUPPORTED_EXTENSIONS_CLOSE_STATUS = 1010,
  WEB_SOCKET_SERVER_ERROR_CLOSE_STATUS = 1011,
  WEB_SOCKET_SECURE_HANDSHAKE_ERROR_CLOSE_STATUS = 1015
} WEB_SOCKET_CLOSE_STATUS;

Constants

 
WEB_SOCKET_SUCCESS_CLOSE_STATUS
Value: 1000
Close completed successfully.
WEB_SOCKET_ENDPOINT_UNAVAILABLE_CLOSE_STATUS
Value: 1001
The endpoint is going away and thus closing the connection.
WEB_SOCKET_PROTOCOL_ERROR_CLOSE_STATUS
Value: 1002
Peer detected protocol error and it is closing the connection.
WEB_SOCKET_INVALID_DATA_TYPE_CLOSE_STATUS
Value: 1003
The endpoint cannot receive this type of data.
WEB_SOCKET_EMPTY_CLOSE_STATUS
Value: 1005
No close status
code was provided.
WEB_SOCKET_ABORTED_CLOSE_STATUS
Value: 1006
The
connection was closed without sending or
receiving a close frame.
WEB_SOCKET_INVALID_PAYLOAD_CLOSE_STATUS
Value: 1007
Data within a message is not consistent with the type of the message.
WEB_SOCKET_POLICY_VIOLATION_CLOSE_STATUS
Value: 1008
The message violates an endpoint's policy.
WEB_SOCKET_MESSAGE_TOO_BIG_CLOSE_STATUS
Value: 1009
The message sent was too large to process.
WEB_SOCKET_UNSUPPORTED_EXTENSIONS_CLOSE_STATUS
Value: 1010
A client endpoint expected the server to negotiate one or more extensions, but the server didn't return them in the response message of the WebSocket handshake.
WEB_SOCKET_SERVER_ERROR_CLOSE_STATUS
Value: 1011
An unexpected condition prevented the server from
fulfilling the request.
WEB_SOCKET_SECURE_HANDSHAKE_ERROR_CLOSE_STATUS
Value: 1015
The
TLS handshake could not be completed.

Requirements

Requirement Value
Minimum supported client Windows 8 [desktop apps only]
Minimum supported server Windows Server 2012 [desktop apps only]
Header websocket.h

See also

WEB_SOCKET_BUFFER