Delphi Indy IdHttpServer understand how Connection.Socket.ReadTimeout work
<p>I want close idle connection on TIdHttpServer.</p>

<p>Here <a href="https://stackoverflow.com/a/35107685/2936170">https://stackoverflow.com/a/35107685/2936170</a> i found</p>

<blockquote>
  <p>[...] the ReadTimeout property can be used to disconnect slow/dead clients that do > not send requests in a timely manner.</p>
</blockquote>

<p>On TIdHttpServer server i have set the ReadTimeout to 1 second on OnConnect event</p>

<pre><code>begin
   IdHTTPServer.KeepAlive        := False;
   IdHTTPServer.OnConnect        := OnConnect;
   IdHTTPServer.DefaultPort      := 80;
   IdHTTPServer.AutoStartSession := False;
   IdHTTPServer.SessionState     := False;

   IdHTTPServer.Active           := True;
end;

procedure OnConnect(AContext: TIdContext);
begin
   AContext.Connection.Socket.ReadTimeout := 1000; // 1 second
end;
</code></pre>

<p>For test the server timeout, i have created a simple client and i make a TCP connection with TIdTCPClient</p>

<pre><code>begin
    IdTCPClient.Port := 80;
    IdTCPClient.Host := '127.0.01';
    IdTCPClient.Connect;
end;
</code></pre>

<p>On windows network activity section, from resource monitor, i see in the tpc connection list the client and the server connection. 
Each connections (server and client) persists over the server timeout... </p>

<p>Why IdHttpServer don't close the connection over the readtimeout?</p>

<p><strong>UPDATE 1</strong></p>

<p>tcp connection disappear after 2 minutes (but my timeout is 1 second).</p>

<p><strong>UPDATE 2</strong></p>

<p>if i comment out the line of readtimeout, the connection never disappear. IdHTTPServer seem to have a defaut infinite timeout. I think readtimeout work, but windows network activity is not a real time status info.  </p>