TsgcHTTP2Client属性 › Throttle

Throttle 属性

限制 HTTP/2 套接字每秒发送或接收的比特数。

语法

property Throttle: TsgcTCPThrottle read GetThrottle write SetThrottle;

默认值

Enabled=False

备注

使用 Throttle 限制 HTTP/2 客户端的出入带宽。启用该功能并设置所需的比特每秒;传输层将暂停读写操作以保持在限制内。在测试 HTTP/2 流式传输或大型下载时,以及在同一进程中运行的多个 HTTP/2 客户端之间共享上行带宽时非常有用。

示例


oHTTP2 := TsgcHTTP2Client.Create(nil);
oHTTP2.Host := 'http2.akamai.com';
oHTTP2.Port := 443;
oHTTP2.TLS := True;
oHTTP2.Throttle.Enabled := True;
oHTTP2.Throttle.BitsPerSec := 256 * 1024;

返回属性