Timeout for IdHTTP

Giganews Newsgroups
Subject: Timeout for IdHTTP
Posted by:  Matthias Wermund (m.wermu…@gg-soft.de)
Date: Mon, 22 Sep 2003


I am trying to make a download procedure which takes care of the user being
on- or offline.
This was my idea of dealing with the problem:

    IndyHTTP.Get(URL, stream);  // tries to download the file
  except  // if the user if offline
    ShowMessage('Please connect yourself to the Internet');

The code works, but it takes ca. 35 seconds until IndyHTTP recognizes that
the user isn't online and raises an exception. That's too long, I mean it
could notice the missing Internet availibility in just a few seconds and
proceed to the exception section.

So do you have any idea how to quickly make sure if the user is online? I
thought the IdHTTP.ReadTimeout property would be the exact thing I needed,
but setting it to 4000 didn't have any influence on my problem.

I am using Delphi 5 with Indy9.

Thanks in advance,