WebClient OpenReadAsync never returns

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • JamesB

    #1

    WebClient OpenReadAsync never returns

    I have a bit of code whereby I use the OpenReadAsync method to open a
    website to ensure it is responding ok.

    After the program has been running for some time, this method never returns
    to my handler for one site (I'm monitoring 3 sites at the moment, the other
    two are fine) however if I open up the relevant site in my browser it's
    actually there.

    So, I see there is a cancelasync method, but the problem here is that my
    program would then go into an error state and alert me that the site was
    down, when in fact it is fine, so that's not much help - any idea what else
    would cause this sort of behaviour?

    I notice that sometimes the program will use up a lot of RAM so I have some
    sort of memory leak going on somewhere - running the CLR profiler it seems
    that strings are relevant but I need to do a lot of reading to understand
    that tool... Would low memory cause the handler for the webclient method to
    never invoke?

    Thanks

Working...