TsgcWebSocketClient › 属性 › 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;