TsgcHTTP2ClientProperties › WatchDog

WatchDog Property

Automatically reconnects to the HTTP/2 server after an unexpected disconnection.

Syntax

property WatchDog: TsgcTCPWatchDog_Options read FWatchDog write SetWatchDog;

Default Value

Enabled=False, Interval=10, Attempts=0

Remarks

When WatchDog.Enabled is True, the client detects a dropped HTTP/2 connection (TCP reset, GOAWAY with no pending requests, keep-alive failure) and tries to reconnect every Interval seconds. Attempts controls the maximum number of reconnect attempts; zero means unlimited retries. Pending requests queued before the disconnection can be replayed after reconnection via the OnHTTP2PendingRequests event.

Example


oHTTP2 := TsgcHTTP2Client.Create(nil);
oHTTP2.Host := 'http2.akamai.com';
oHTTP2.Port := 443;
oHTTP2.TLS := True;
oHTTP2.WatchDog.Interval := 10;
oHTTP2.WatchDog.Attempts := 0;
oHTTP2.WatchDog.Enabled := True;

Back to Properties