TsgcHTTP2Client › Properties › WatchDog
Automatically reconnects to the HTTP/2 server after an unexpected disconnection.
property WatchDog: TsgcTCPWatchDog_Options read FWatchDog write SetWatchDog;
Enabled=False, Interval=10, Attempts=0
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.
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;