TsgcWebSocketServer_HTTPAPIProperties › Timeouts

Timeouts 属性

覆盖默认的 http.sys 请求、实体主体、保持连接和发送速率超时设置。

语法

property Timeouts: TsgcWSTimeouts_HTTPAPI read FTimeouts write SetTimeouts;

默认值

Enabled=FalseEntityBody=120DrainEntityBody=120RequestQueue=120IdleConnection=120HeaderWait=120MinSendRate=150

备注

Enabled 设置为 True 并为子属性赋值,以覆盖请求队列上内置的 http.sys 超时。EntityBody 是允许请求实体正文到达的秒数;DrainEntityBody 是服务器在 Keep-Alive 连接上排空实体正文的允许时间;RequestQueue 是请求在内核队列中等待用户模式拾取的最长时间;IdleConnection 在指定秒数后关闭空闲的 Keep-Alive 连接;HeaderWait 限制解析请求头部的时间。MinSendRate 以字节/秒表示,设置响应的最低发送速率(内核默认值为 150 字节/秒)。值为 0 表示保留该子字段的内核默认值。

示例


oServer := TsgcWebSocketServer_HTTPAPI.Create(nil);
oServer.Host := '127.0.0.1';
oServer.Port := 80;
oServer.Timeouts.Enabled := true;
oServer.Timeouts.EntityBody := 60;
oServer.Timeouts.HeaderWait := 30;
oServer.Timeouts.IdleConnection := 120;
oServer.Timeouts.MinSendRate := 150;
oServer.Active := true;

返回属性