Note that there are some explanatory texts on larger screens.

plurals
  1. POThe connection does not timeout while using Indy
    primarykey
    data
    text
    <p>I want to download a file from internet and I imagine this should be a simple task. Trying several different approaches I have found that each one has its own drawback. The main issues are:</p> <ul> <li>Application freezes until it downloads the file</li> <li>Application freezes forever if the Internet connection is lost/server does not respond.</li> </ul> <p>(details:</p> <p><a href="https://stackoverflow.com/questions/3122306/how-to-retrieve-a-file-from-internet-via-http">How to retrieve a file from Internet via HTTP?</a><br> <a href="https://stackoverflow.com/questions/3135003/the-connection-does-not-timeout-while-downloading-file-from-internet">The connection does not timeout while downloading file from internet</a> )</p> <p>So, finally I used the suggestions I got from several people to use "pro" libraries such as Indy. However, Indy is not much better than the pieces of code I have tried (but it is way much larger and difficult to maintain). While using Indy the application does not freezes only for short periods so it is still (somehow) usable. However, the application cannot be shut down until the download finishes (never if the Internet connections gets broken). </p> <p>Other people reported the same problem: <a href="http://borland.newsgroups.archived.at/public.delphi.internet.winsock/200609/0609079112.html" rel="nofollow noreferrer">http://borland.newsgroups.archived.at/public.delphi.internet.winsock/200609/0609079112.html</a><br> <a href="https://forums.embarcadero.com/thread.jspa?threadID=25199&amp;tstart=90" rel="nofollow noreferrer">https://forums.embarcadero.com/thread.jspa?threadID=25199&amp;tstart=90</a></p> <p>So, there is some hacking I had to do to TIDAntiFreeze in order to make it work?</p> <p>Also, the ConnectTimeout property is not recognized.</p> <pre><code>fIDHTTP := TIDHTTP.Create(NIL); fIDHTTP.ConnectTimeout:=5000; </code></pre> <p>Should I drop Indy and return to original idea of downloading the file in a separate thread and end the thread when it does not respond (at least this way I get rid of 3rd party libraries)? There will be unforeseen side effects if I do this?</p> <p>Using: Delphi 7, Indy <strike>10.1.5</strike> 10.5 (probably).</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload