DownloadFileAsync only downloads two files at a time  
Author Message
Joel Harris





PostPosted: .NET Framework Networking and Communication, DownloadFileAsync only downloads two files at a time Top

I am creating any number of threads. Each one calls the WebClient.DownloadFileAsync() method. The problem is that only two downloads ever occur simultaneously. The other downloads don't begin until a thread that is currently downloading finishes, always maintaining a maximum of two concurrent downloads. I need all the downloads to occur simultaneously.

Thanks

Joel Harris.



.NET Development13  
 
 
Joel Harris





PostPosted: .NET Framework Networking and Communication, DownloadFileAsync only downloads two files at a time Top

This is a restriction of IIS on XP Pro.
 
 
RizwanSharp





PostPosted: .NET Framework Networking and Communication, DownloadFileAsync only downloads two files at a time Top

Agreed, Its a Restriction of Windows XP but not from the IIS, because you can download files even you dont have IIS Installed.

I once saw a tweek on some XP Tweek Techniques Website which allowed me to modify that number (2) to my own value so You can put there 10, you'll get 10 downloades simultainously.

So If you are writing your own Application You can modify that value programatically to support more number of downloads concurrently!

In last I dont know that it's limited to Windows XP, or also other version of Windows, If it's only part of Windows XP then you can check the Version using Environment Variable and detect if application is running on Windows XP so Tweek it.

I'm sorry I dont know where I found that tweek long time ago but I know I did it and I downloaded more and more concurrently! So go ahead and search for that thing or ask some Windows Registry Expert!

Best Regards,



 
 
Mariya Atanasova - MSFT





PostPosted: .NET Framework Networking and Communication, DownloadFileAsync only downloads two files at a time Top

The default connection limit is 2. There is a good article about http://blogs.msdn.com/mflasko/archive/2005/09/11/463865.aspx

 In order to increase the limit to up to 10 concurrent connections for example, add the line before creating the TcpClient

ServicePointManager.DefaultConnectionLimit = 10;
TcpClient tc = new TcpClient();


Mariya