TsgcWebSocketClientProperties › Throttle

Throttle Property

Limits the number of bits per second sent or received by the client socket.

Syntax

property Throttle: TsgcWSThrottle read GetThrottle write SetThrottle;

Default Value

Enabled=False

Remarks

Use Throttle to cap the outgoing and incoming bandwidth of the client. Enable the feature and set the desired bits-per-second; the transport layer pauses read/write operations to stay within the limit, which is useful to simulate slow networks or to share upstream bandwidth between connections.

Example


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

Back to Properties