TsgcHTTP2Clientプロパティ › HeartBeat

HeartBeat プロパティ

接続を維持するために定期的に HTTP/2 PING フレームを送信します。

構文

property HeartBeat: TsgcTCPHeartBeat_Options read FHeartBeat write SetHeartBeat;

デフォルト値

Enabled=False

解説

HeartBeat.EnabledTrue の場合、クライアントはプロキシや 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;

プロパティに戻る