title: Indy TIdTCPClient ConnectTimout not working
body: <p>I have a TIdTCPClient which is trying to connect to a host which is not online.</p>
  
  <p><strong>UPDATE:</strong><br>
  After diving a bit deeper into WINSOCK2 it seems like this is indeed an issue which is depending on your operating system. Maybe there will be a fix in a future release.
  (See the comments of this question for more details)</p>
  
  <p><strong>Setup:</strong></p>
  
  <ul>
  <li>Delphi 10 Seattle </li>
  <li>Windows 7 64-Bit</li>
  <li>Indy 10.6.2.5311</li>
  </ul>
  
  <p>The ConnectTimeout is set to 5000 ms so I would expect to get at least a ConnectTimeout after 5 seconds. However on my current machine it takes over 20 seconds to receive that Timeout. </p>
  
  <p>So far I see that the ConnectionTimeout is handled correctly but on <em>TIdIOHandlerStack.ConnectClient</em> there is an <strong>WaitFor</strong> on the thread which performs the actual connection attempt. 
  I think this is causing the delayed connection timeout, but I don't know what I could do about that. Any Ideas?</p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>procedure TForm1.btn1Click(Sender: TObject);
  begin
    try
      Self.mmo1.Lines.Add(TimeToStr(now));
      Self.idtcpclnt1.Host := '192.148.89.112';
      Self.idtcpclnt1.Port := 9200;
      Self.idtcpclnt1.Connect;
    except on E: Exception do
      Self.mmo1.Lines.Add(TimeToStr(now)+ ' : '+E.Message);
    end;
  end;
  
  procedure TForm1.idtcpclnt1Status(ASender: TObject; const AStatus: TIdStatus;
      const AStatusText: string);
  begin
    Self.mmo1.Lines.Add(TimeToStr(now)+ ' : ' +AStatusText);
  end;
  </code></pre>
  
  <p>Result of this code:</p>
  
  <p><a href="https://i.stack.imgur.com/7ak6t.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7ak6t.png" alt="image"></a></p>