|
-
Mar 22nd, 2011, 11:44 AM
#1
Thread Starter
Fanatic Member
WebClient Timed Out after 10 minutes
Hi,
I run a program with 20 threads getting data from web.
After about 10 minutes I keep getting operation timed out exception.
If I restart the program it works again for 10 minutes.
Looks like there is a memory leak or something.
Some says that webclient uses webrequest object somewhere. I do not see it in watch though.
Also some says that max connection can happen. How to prevent that?
-
Mar 22nd, 2011, 08:51 PM
#2
Re: WebClient Timed Out after 10 minutes
How does your program retrieve information? Does it increment a counter? Are the parameters you are passing to the web application (if any) out of the valid range? Does the website have an anti-DoS-attack functionality that rejects connections if too many have come from the same place in a short period of time?
-
Mar 24th, 2011, 10:52 AM
#3
Thread Starter
Fanatic Member
Re: WebClient Timed Out after 10 minutes
I believe the issue is that if loading fail I would terminate the thread. Webclient, uses webrequest inside. I think in webrequest you need to close connection or something.
I do not think the site is an issue because ending the program and restarting it will work.
-
Mar 24th, 2011, 10:53 AM
#4
Re: WebClient Timed Out after 10 minutes
-
Mar 24th, 2011, 12:04 PM
#5
Thread Starter
Fanatic Member
Re: WebClient Timed Out after 10 minutes
vb.net Code:
Try theEnchancedWinClient.WebClient = New System.Net.WebClient System.Diagnostics.Debug.Print("Grab URL " + theEnchancedWinClient.PackedScannable) .Result = theEnchancedWinClient.WebClient.DownloadString(theEnchancedWinClient.PackedScannable) System.Diagnostics.Debug.Print("Finish Grabbing URL " + theEnchancedWinClient.PackedScannable) Catch ex As Exception System.Diagnostics.Debug.Print("Failure to load") theEnchancedWinClient.Thread.Abort() End Try
-
Mar 24th, 2011, 12:10 PM
#6
Re: WebClient Timed Out after 10 minutes
First of all, try only using one WebClient (for all threads or per thread). That would definitely save on memory.
What is the value of PackedScannable?
-
Mar 24th, 2011, 12:26 PM
#7
Thread Starter
Fanatic Member
Re: WebClient Timed Out after 10 minutes
The URL. I used to use only one webclient. I changed that thinking it'll work better.
-
Mar 24th, 2011, 12:32 PM
#8
Re: WebClient Timed Out after 10 minutes
I know the value of PackedScannable is the URL, what is the URL?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|