Results 1 to 8 of 8

Thread: WebClient Timed Out after 10 minutes

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2007
    Posts
    544

    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?

  2. #2
    Stack Overflow mod​erator
    Join Date
    May 2008
    Location
    British Columbia, Canada
    Posts
    2,824

    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?

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2007
    Posts
    544

    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.

  4. #4
    Stack Overflow mod​erator
    Join Date
    May 2008
    Location
    British Columbia, Canada
    Posts
    2,824

    Re: WebClient Timed Out after 10 minutes

    Can you post your code?

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2007
    Posts
    544

    Re: WebClient Timed Out after 10 minutes

    vb.net Code:
    1. Try
    2.                 theEnchancedWinClient.WebClient = New System.Net.WebClient
    3.                 System.Diagnostics.Debug.Print("Grab URL " + theEnchancedWinClient.PackedScannable)
    4.                 .Result = theEnchancedWinClient.WebClient.DownloadString(theEnchancedWinClient.PackedScannable)
    5.                 System.Diagnostics.Debug.Print("Finish Grabbing URL " + theEnchancedWinClient.PackedScannable)
    6.             Catch ex As Exception
    7.                 System.Diagnostics.Debug.Print("Failure to load")
    8.                 theEnchancedWinClient.Thread.Abort()
    9.             End Try

  6. #6
    Stack Overflow mod​erator
    Join Date
    May 2008
    Location
    British Columbia, Canada
    Posts
    2,824

    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?

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2007
    Posts
    544

    Re: WebClient Timed Out after 10 minutes

    The URL. I used to use only one webclient. I changed that thinking it'll work better.

  8. #8
    Stack Overflow mod​erator
    Join Date
    May 2008
    Location
    British Columbia, Canada
    Posts
    2,824

    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
  •  



Click Here to Expand Forum to Full Width