WEB_SOCKET_BUFFER union (websocket.h)

The WEB_SOCKET_BUFFER structure contains data for a specific WebSocket action.

Syntax

typedef union _WEB_SOCKET_BUFFER {
  struct {
    PBYTE pbBuffer;
    ULONG ulBufferLength;
  } Data;
  struct {
    PBYTE  pbReason;
    ULONG  ulReasonLength;
    USHORT usStatus;
  } CloseStatus;
} WEB_SOCKET_BUFFER, *PWEB_SOCKET_BUFFER;

Members

Data

Data.pbBuffer

Type: PBYTE Pointer to the WebSocket buffer data.

Data.ulBufferLength

Type: ULONG Length, in bytes, of the buffer pointed to by pbBuffer.

CloseStatus

CloseStatus.pbReason

Type: PBYTE A point to a UTF-8 string that represents the reason the connection is closed. If ulReasonLength is 0, this must be NULL.

CloseStatus.ulReasonLength

Type: ULONG Length, in bytes, of the buffer pointed to by pbReason. It cannot exceed WEB_SOCKET_MAX_CLOSE_REASON_LENGTH (123 bytes).

CloseStatus.usStatus

Type: USHORT

WEB_SOCKET_CLOSE_STATUS enumeration that specifies the WebSocket status.

Remarks

Application must use the Data struct for all buffer types except WEB_SOCKET_CLOSE_BUFFER_TYPE. The CloseStatus struct is used for WEB_SOCKET_CLOSE_BUFFER_TYPE.

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_TYPE

WebSocketGetAction

WebSocketReceive

WebSocketSend