WebClient OpenReadAsync never returns

  • Thread starter Thread starter JamesB
  • Start date Start date
J

JamesB

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top