Click here to Skip to main content
15,889,651 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I may be totally wrong with this, as im not sure if its possible to accomplish, but is there any way I can open a http connection to a host/website and using *only* that connection download responses from different requests pages?

I'm trying to monitor my router status and i need to fetch 3 different pages and parse the details but i do not want to have 3 connections to open/close every second that just stress out the router without sense, i want to only open one connection to it, is it possible? or i need one connection per page and set it as persistent?
Posted

1 solution

Maintaining an open connection was introduced in HTTP 1.1.

As far as stressing your router, that's not going to happen. If your router can't handle 3 requests a second, you need a better router.

You would use the WebClient class to do this. You can find an example here[^]. In order to do multiple requests, you have to setup the headers you want (on each request), then just use the appropriate Downloadxxxx method to get the data you want.
 
Share this answer
 
Comments
creizlein 23-Jun-11 2:48am    
You are right, its not that the router cant handle the connections, is just that i feel its not right to implement it that way, the monitor is going to run 24/7 and creating 3 connections every second to a host which is always the same seems bad, i assume that somehow it add some overheat, so i cant to do it with a persistent one.

Thanks for your link do, i will give it a try and convert it to VB.net

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900