1
Vote

Trying to download all files results in TimeOut exceptions

description

Trying to recursively scan all folders, and download all files result in TimeOut exceptions.
This is caused by HttpWebResponse objects not being closed.
 
I suggest you make the following changes:
  • Add "using()" whenever calling the method HttpWebClient.SendHttpWebRequest()
  • Inside method HttpWebClient.SendHttpWebRequest(), when you are making recursive calls, call the "Close()" method on the existing HttpWebResponse before overwriting it.

comments

ghollosy wrote Aug 22, 2011 at 1:29 PM

Thanks for your observation, I'll fix this ASAP.

prathiba wrote Aug 25, 2011 at 2:55 PM

Try this
skydrive.Timeout = 2147483647;

saguiitay wrote Aug 25, 2011 at 3:55 PM

Increasing the Timeout won't help.
.Net Framework limits the number of open Request/Reponse each process has. If you open too many requests (and their respective Response), and don't close them, at some point the .Net Framework will stop opening new requests, and will just "wait" until you close some of the opened ones...