TsgcWebSocketServerProperties › Throttle

Throttle Property

Caps the bandwidth (bits per second) that the server reads from or writes to each connection.

Syntax

property Throttle: TsgcWSThrottle read GetThrottle write SetThrottle;

Default Value

Enabled=False

Remarks

When Throttle.Enabled is True the server limits how fast data may be read or written per connection. Use it to prevent a single client from saturating the uplink or to simulate low-bandwidth scenarios during development. Throttling is applied at the socket level and is independent from RateLimiter (which limits request/message rates) or MaxConnections (which caps concurrent sessions).

Example


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

Back to Properties