Re: WebRequest times out...but only 3rd time and on...
- From: "Tim Cowan" <timcowan@xxxxxxxxxxxx>
- Date: Thu, 23 Feb 2006 10:09:23 -0500
Thanks Jon, that was it. As I wasn't putting it into a reponse object I
couldn't see it, but now it works great.
System.Net.WebResponse resp = req.GetResponse();
resp.Close();
"Jon Skeet [C# MVP]" <skeet@xxxxxxxxx> wrote in message
news:1140705186.030954.131170@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Tim Cowan wrote:
I put this code in a windows forms app for testing. The IP values are
both
correct. It works the first time, the second time but at the third time
it
fails with timeout... I have it running here AND in a service with a 30
minute interval.
1. Am I doing this correclty? Is there a better way to go to a URI and
pass
a couple of variables?
I don't have time to look at the rest of your code in detail at the
minute, but I believe the problem is that you're not disposing of the
WebResponse. If you do, you should notice everything being fine. .NET
is happy to have two connections up at a time, but your existing
responses are "hogging" the connections it's made.
Jon
.
- Follow-Ups:
- Re: WebRequest times out...but only 3rd time and on...
- From: Jon Skeet [C# MVP]
- Re: WebRequest times out...but only 3rd time and on...
- References:
- WebRequest times out...but only 3rd time and on...
- From: Tim Cowan
- Re: WebRequest times out...but only 3rd time and on...
- From: Jon Skeet [C# MVP]
- WebRequest times out...but only 3rd time and on...
- Prev by Date: RUnning a console program hidden?
- Next by Date: Re: Reading Registry Values in Windows NT Service
- Previous by thread: Re: WebRequest times out...but only 3rd time and on...
- Next by thread: Re: WebRequest times out...but only 3rd time and on...
- Index(es):
Relevant Pages
|