TsgcHTTP2ClientProperties › HeartBeat

HeartBeat Property

Sends periodic HTTP/2 PING frames to keep the connection alive.

Syntax

property HeartBeat: TsgcTCPHeartBeat_Options read FHeartBeat write SetHeartBeat;

Default Value

Enabled=False

Remarks

When HeartBeat.Enabled is True, the client sends an HTTP/2 PING frame every Interval seconds to keep the connection alive through proxies and NAT devices. HeartBeatType selects the strategy: hbtAlways sends a ping on every interval while hbtOnlyIfNoMsgRcvInterval only pings when no data has been received during the last interval. This is particularly useful for long-lived HTTP/2 connections used for streaming or server push.

Example


oHTTP2 := TsgcHTTP2Client.Create(nil);
oHTTP2.Host := 'http2.akamai.com';
oHTTP2.Port := 443;
oHTTP2.TLS := True;
oHTTP2.HeartBeat.Interval := 30;
oHTTP2.HeartBeat.Enabled := True;

Back to Properties