Skip to main content
WEB_SOCKET_BUFFER union

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;

Members

Data
pbBuffer

Type: PBYTE

Pointer to the WebSocket buffer data.

ulBufferLength

Type: ULONG

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

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.

ulReasonLength

Type: ULONG

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

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

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