Using TIdHTTPServer (Indy 10.6), i want set a connection timeout for close slow or inactive client (client are common browser) and close all zombie connection after 60 seconds of inactivity. I have found Socket.ReadTimeout in TIdContext.Connection. Is this the right way? TIdHTTPServer already perform this (it seem have infinite timeout)?
WebServer := TIdHTTPServer.Create(nil);
WebServer.SessionState := false;
WebServer.KeepAlive := false;
WebServer.OnCommandGet := CustomOnCommandGet;
procedure CustomOnCommandGet(AContext: TIdContext; ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo;
begin
AContext.Connection.Socket.ReadTimeout := 60000;
AResponseInfo.ContentStream := TFileStream.Create('C:/file.zip', fmOpenRead or fmShareCompat);
end;