TsgcWebSocketHTTPServer › 属性 › MaxConnections
服务器可接受的最大并发客户端连接数。
property MaxConnections: Integer read GetMaxConnections write SetMaxConnections;
0(无限制)
当 MaxConnections 大于零时,服务器在达到限制后拒绝新的传入 TCP 连接;现有会话不受影响。使用此属性防止主机在突发负载下资源耗尽,或在负载均衡集群中限制容量。值为 0 时禁用限制。与 RateLimiter 或 Firewall 结合使用,可实现更精细的准入控制。
oServer := TsgcWebSocketHTTPServer.Create(nil);
oServer.Port := 80;
oServer.MaxConnections := 1000;
oServer.Active := true;