TsgcWebSocketHTTPServer属性 › Throttle

Throttle 属性

限制服务器对每个连接读取或写入的带宽(位/秒)。

语法

property Throttle: TsgcWSThrottle read GetThrottle write SetThrottle;

默认值

Enabled=False

备注

Throttle.EnabledTrue 时,服务器会限制每个连接的数据读写速率。可用于防止单个客户端占满上行带宽,或在开发过程中模拟低带宽场景。限速在套接字层应用,独立于 RateLimiter(限制请求/消息速率)和 MaxConnections(限制并发会话数)。

示例


oServer := TsgcWebSocketHTTPServer.Create(nil);
oServer.Throttle.BitsPerSec := 65536;
oServer.Throttle.Enabled := true;
oServer.Active := true;

返回属性