TsgcWebSocketClient属性 › Throttle

Throttle 属性

限制客户端套接字每秒发送或接收的比特数。

语法

property Throttle: TsgcWSThrottle read GetThrottle write SetThrottle;

默认值

Enabled=False

备注

使用 Throttle 限制客户端的出入站带宽。启用该功能并设置所需的比特每秒值;传输层将暂停读写操作以保持在限制范围内,这对于模拟慢速网络或在连接之间共享上行带宽非常有用。

示例


oClient := TsgcWebSocketClient.Create(nil);
oClient.URL := 'wss://www.esegece.com:2053';
oClient.Throttle.Enabled := true;
oClient.Throttle.BitsPerSec := 256 * 1024;
oClient.Active := true;

返回属性