TsgcWebSocketServerProperties › MaxConnections

MaxConnections Property

Maximum number of concurrent client connections accepted by the server.

Syntax

property MaxConnections: Integer read GetMaxConnections write SetMaxConnections;

Default Value

0 (unlimited)

Remarks

When MaxConnections is greater than zero the server refuses new incoming TCP connections once the limit is reached; existing sessions are unaffected. Use this property to protect the host from resource exhaustion under sudden load or to cap capacity in a load-balanced farm. A value of 0 disables the limit. Combine with RateLimiter or Firewall for finer-grained admission control.

Example


oServer := TsgcWebSocketServer.Create(nil);
oServer.Port := 80;
oServer.MaxConnections := 1000;
oServer.Active := true;

Back to Properties