TsgcWSAPIServer_WebPush › Methods › KeepAlive
Inherited helper that writes a keepalive/ping frame to a single WebSocket connection so idle links stay open through proxies.
procedure KeepAlive(const aConnection: TsgcWSConnection; const aMessage: string);
| Name | Type | Description |
|---|---|---|
aConnection | const TsgcWSConnection | WebSocket connection held by the attached server that should receive the keepalive frame. |
aMessage | const string | Optional payload carried inside the keepalive frame; pass an empty string for a bare ping. |
Exposed by the base API server class for scenarios where the same component also manages long-lived WebSocket sessions alongside the Web Push HTTP endpoints. Typical Web Push traffic is short-lived HTTPS POSTs to the browser push service and does not require keepalives, so you normally only call this method when you have upgraded a client to WebSocket through the same listener.
sgcWSAPIServer_WebPush1.KeepAlive(aConnection, '');