Re: Bug in HttpWebRequest/Response Dispose() implementation?
- From: "Vagif Abilov" <vagif@xxxxxxxxx>
- Date: Wed, 5 Jul 2006 22:47:14 +0200
I am not in the office right now, but I guess the original code looked like
this:
HttpWebRequest request = PrepareRequest(...);
using(HttpWebResponse response = (HttpWebResponse)request.GetResponse())
{
... do something with response
}
HttpWebRequest is not disposable, so we applied "using" pattern to
HttpWebResponse object only.
While searching for the source of the problem, I found couple of documents:
http://dturini.blogspot.com/2004/06/on-past-few-days-im-dealing-with-some.html
http://support.microsoft.com/?kbid=831138
Looks like there .NET 1.1 had a problem with release of unmanaged resources
allocated by HttpResponse. Does .NET 2.0 has the same problem?
Vagif
"Jon Skeet [C# MVP]" <skeet@xxxxxxxxx> wrote in message
news:MPG.1f1628b79eefde3798d2c3@xxxxxxxxxxxxxxxxxxxxxxx
Vagif Abilov <vagif@xxxxxxxxx> wrote:
Hello,
We have a simple piece of code that exchanges data using HTTP
request/reponse. It uses "using" statement to guarantee that the
communication channel is properly closed on completion. However, if the
code
is executed multiple times, the first execution attempt works fine, but
the
second attempt times out.
<snip>
Why using Dispose method does not do the same? Isn't it the purpose of
IDisposable interface?
Yes. Could you show us the code that doesn't work, preferrably as a
short but complete program?
--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
.
- Follow-Ups:
- Re: Bug in HttpWebRequest/Response Dispose() implementation?
- From: Jon Skeet [C# MVP]
- Re: Bug in HttpWebRequest/Response Dispose() implementation?
- References:
- Bug in HttpWebRequest/Response Dispose() implementation?
- From: Vagif Abilov
- Re: Bug in HttpWebRequest/Response Dispose() implementation?
- From: Jon Skeet [C# MVP]
- Bug in HttpWebRequest/Response Dispose() implementation?
- Prev by Date: Re: Bug in HttpWebRequest/Response Dispose() implementation?
- Next by Date: Re: Bug in HttpWebRequest/Response Dispose() implementation?
- Previous by thread: Re: Bug in HttpWebRequest/Response Dispose() implementation?
- Next by thread: Re: Bug in HttpWebRequest/Response Dispose() implementation?
- Index(es):
Relevant Pages
|
Loading