TsgcWebSocketServer_HTTPAPIProperties › MaxBandwidth

MaxBandwidth Property

Maximum allowed bandwidth in bytes per second across all connections (zero means unlimited).

Syntax

property MaxBandwidth: Integer read FMaxBandwidth write FMaxBandwidth;

Default Value

0 (unlimited)

Remarks

Caps the aggregate send rate in bytes per second; the value is applied at the URL-group level through the http.sys HttpServerBindingProperty / HttpServerQosProperty settings and enforced by the kernel driver. A value of 0 (the default) disables the limit. Useful to throttle a server that shares bandwidth with other services or to cap egress costs on cloud deployments. Note: the cap applies to outbound traffic only — ingress is not limited by this property. Combine with RateLimiter for finer per-peer control.

Example


oServer := TsgcWebSocketServer_HTTPAPI.Create(nil);
oServer.Host := '127.0.0.1';
oServer.Port := 80;
// cap total egress at 1 MB/sec
oServer.MaxBandwidth := 1048576;
oServer.Active := true;

Back to Properties