TsgcWebSocketProxyServer › Properties › MaxConnections

MaxConnections 属性

代理接受的最大并发下游客户端连接数。

语法

property MaxConnections: Integer read GetMaxConnections write SetMaxConnections;

默认值

0(无限制)

备注

当 MaxConnections 大于零时,代理一旦达到该限制,将拒绝来自下游客户端的新 TCP 传入连接;现有会话(及其与 Proxy 中定义的服务器的对应上行链路)不受影响。使用此属性可防止主机资源耗尽,或在多个代理位于公共负载均衡器后时限制容量。值为 0 时禁用限制。请记住,每个被接受的下游客户端都会向上行服务器建立一个额外的出站连接,因此实际套接字消耗大约是两倍。

示例


oProxy := TsgcWebSocketProxyServer.Create(nil);
oProxy.Port := 80;
oProxy.MaxConnections := 1000;
oProxy.Proxy.Host := 'upstream.example.com';
oProxy.Proxy.Port := 8080;
oProxy.Active := true;

返回属性