TsgcTCPClient › 属性 › Throttle
限制客户端套接字每秒发送或接收的比特数。
property Throttle: TsgcWSThrottle read GetThrottle write SetThrottle;
Enabled=False
使用 Throttle 限制客户端的出入站带宽。启用该功能并设置所需的比特每秒值;传输层将暂停读写操作以保持在限制范围内,这对于模拟慢速网络或在连接之间共享上行带宽非常有用。
oTCP := TsgcTCPClient.Create(nil);
oTCP.Host := 'www.esegece.com';
oTCP.Port := 2053;
oTCP.Throttle.Enabled := true;
oTCP.Throttle.BitsPerSec := 256 * 1024;
oTCP.Active := true;