Skip to main content

HCWebSocketGetPingInterval

Gets the keepalive ping interval, in seconds, that the title set for a WebSocket.

Syntax

Parameters

websocket   _In_
Type: HCWebsocketHandle
The handle of the WebSocket. pingIntervalSeconds   _Out_
Type: uint32_t*
Receives the ping interval, in seconds. Receives 0 if the title didn’t set an interval.

Return value

Type: HRESULT Returns S_OK on success, or E_INVALIDARG if websocket or pingIntervalSeconds is nullptr.

Remarks

The title sets the interval with HCWebSocketSetPingInterval before it calls HCWebSocketConnectAsync. This function returns the value that the title requested. If you implement HCWebSocketConnectFunction, call this function to read the interval and configure keepalive frames. On Windows and XBOX consoles, the built-in implementation sets the WinHTTP WebSocket keepalive interval only when the value is greater than 0, and raises values from 1 through 14 to 15 seconds, the WinHTTP minimum keepalive interval. When the value is 0, the built-in implementation keeps the WinHTTP default. This function isn’t declared when HC_NOWEBSOCKETS is defined.

Requirements

Header: httpProvider.h Library: libHttpClient.lib Supported platforms: Windows, XBOX One family consoles and XBOX Series consoles

See also

httpProvider
HCWebSocketConnectFunction
HCWebSocketSetPingInterval
Last modified on October 30, 2026