TsgcWebSocketHTTPServer属性 › MaxConnections

MaxConnections 属性

服务器可接受的最大并发客户端连接数。

语法

property MaxConnections: Integer read GetMaxConnections write SetMaxConnections;

默认值

0(无限制)

备注

MaxConnections 大于零时,服务器在达到限制后拒绝新的传入 TCP 连接;现有会话不受影响。使用此属性防止主机在突发负载下资源耗尽,或在负载均衡集群中限制容量。值为 0 时禁用限制。与 RateLimiterFirewall 结合使用,可实现更精细的准入控制。

示例


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

返回属性