开发者

Download transfer speed slow when using WebClient

I've built a simple .NET 4 custom downloader console app and am finding that the download speeds I get are much slower than expected.

Using either the DownloadFile() or DownloadFileAsync() methods, the rate at which the files on disk grow in size is, at best, one-fifth of that seen when downloading the same file with Firefox, prob开发者_高级运维ably closer to one-tenth.

There are lots of other questions on S.O. about poor performance with WebClient, but they all seem to hinge on the connection time, rather than the actual bitrate once the transfer has begun. I am generally downloading large files (several tens of MB or greater), so it's the actual rate of file transfer that is important. I have set the Proxy property of the WebClient instance to null to help with the connection speed, but as I said, that isn't the problem I am concerned with anyway.

Is there any obvious reason for this? I know many programs operate multiple threads, but I thought this was only really applicable to the simultaneous downloading of multiple files. And why should a single downloading thread be limited to so much less than the available bandwidth anyway?


I am made a similar project and determined webclient is slow. May I suggest using BITS. It has resume capability and foreground downloads are faster than webclient.

I use my own optimized SharpBits.Net, feel free to use it: http://code.google.com/p/sevenupdate/source/browse/#hg%2FExternals%2FSharpBits.Base

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜