TsgcWebSocketServer_HTTPAPI属性 › MaxConnections

MaxConnections 属性

http.sys 监听器接受的最大并发客户端连接数(零表示无限制)。

语法

property MaxConnections: Integer read FMaxConnections write FMaxConnections;

默认值

0(无限制)

备注

当该值大于零时,一旦达到限制,服务器将拒绝新的传入连接;现有会话不受影响。值为 0 时禁用上限(默认值)。可使用此属性在突发负载下保护主机免受资源耗尽,或在负载均衡集群中限制容量。该值在内核接受套接字后于用户态层面执行;若需更早拒绝流量,请结合使用 FirewallRateLimiter

示例


oServer := TsgcWebSocketServer_HTTPAPI.Create(nil);
oServer.Host := '127.0.0.1';
oServer.Port := 80;
oServer.MaxConnections := 1000;
oServer.Active := true;

返回属性