Home > Back-end >  For a stable network file download, now often jammed abnormal program exit
For a stable network file download, now often jammed abnormal program exit

Time:09-20

Program XXX from the network to a website to download respectively N PDF file, the file is not a single file about 2 m just site situation a lot: file does not exist, particularly slow, file is not complete, the network is not stable, etc.,


Currently used URLDownloadToFile, indy idhttp get, bWinhttp5 method will have the occasional exception program exits

Also sent a few posts
http://bbs.csdn.net/topics/391077584
http://bbs.csdn.net/topics/391045083

No valuable reply, but three posts to along with all the points,

CodePudding user response:

Death has nothing to do with downloading efficiency, is your thread handle

I'm in multiple files to download if the thread in turn caused by speed has been waiting for the download is complete so will wait
I am circulating a single file download download into the multithreading a thread end begin to download another file

If a file is slow may have to wait a long time to have a better solution


Your thread in the process of circulation download, set the timeout, give up the current task, overtime to get to the next task, the main interface will not be affected by any

Use URLDownloadToFile functions download, download it provides a callback interface, can download thread management
http://blog.sina.com.cn/s/blog_4ad042e50102e1pe.html
Use INDY components, should have a timeout parameter directly, not earnest see

CodePudding user response:

To download through the thread by thread tends to cause false crash (stagnation of thread), using a thread, to set up the wait time, overtime is fail (download),

CodePudding user response:

O URLDownloadToFile fine with this,

CodePudding user response:

reference case5166 reply: 3/f
URLDownloadToFile use this, o good

indeed

CodePudding user response:

I have to find the right control, after the test is stable these days, meet my needs

CodePudding user response:

The control tell everyone sharing achievement,

CodePudding user response:

URLDownloadToFile useful ah, you are batch download?

CodePudding user response:

Ics, don't use multithreading, each file download failure can retry several times, public use indy will have a lot of problems

CodePudding user response:

reference 5 floor chinawcs reply:
I have to find the right control, after testing these days is very stable, meet the needs of my




The original poster can share under control, I also encountered the same problem, various methods are tried still couldn't download,