I have implemented a simple HttpRequest client which hits the target website and download the required data. Everything was fine until i moved it be a multi-threaded applications. There i found out that my requests are being timed-out. On further investigating i found out that i need to set System.Net.ServicePointManager.DefaultConnectionLimit = 100;
to get it working. I tried that but i didn't work. I have also tried adding
<system.net>
<connectionManagement>
<add address = "*" maxconnection = "100" />
</connectionManagement>
</system.net>
to app.config
, machine.config
and web.config
. Still i am never able to fire more than 5-6 requests and the remaining starts throwing time-out error. Any help will be highly appreciated.