TsgcHTTP2Client › プロパティ › HeartBeat
接続を維持するために定期的に HTTP/2 PING フレームを送信します。
property HeartBeat: TsgcTCPHeartBeat_Options read FHeartBeat write SetHeartBeat;
Enabled=False
HeartBeat.Enabled が True の場合、クライアントはプロキシや NAT デバイスを通じて接続を維持するために、Interval 秒ごとに HTTP/2 PING フレームを送信します。HeartBeatType は戦略を選択します: hbtAlways はすべてのインターバルでピングを送信し、hbtOnlyIfNoMsgRcvInterval は最後のインターバル中にデータを受信しなかった場合のみピングを送信します。これはストリーミングやサーバープッシュに使用される長期 HTTP/2 接続に特に役立ちます。
oHTTP2 := TsgcHTTP2Client.Create(nil);
oHTTP2.Host := 'http2.akamai.com';
oHTTP2.Port := 443;
oHTTP2.TLS := True;
oHTTP2.HeartBeat.Interval := 30;
oHTTP2.HeartBeat.Enabled := True;