Will the "Underlying connection closed" bug be fixed?

S

Sin Jeong-hun

I don't get the message so it's hard to debug that, but some of my
clients report that they get "The underlying connection was closed
unexpectedly" exception. According to this site (http://
www.dotnetspider.com/resources/2596-e-underlying-connection-was-closed-A-connection.aspx),
it's a bug of .NET 2.0, and the author suggests that we use
KeepAlive=false until Microsoft fixes it.

It seems like almost 5 years have passes since the release of .NET
2.0, and this stilll exists. Should I wait for the fix, or use
KeepAlive=false instead?
 
T

Tester

Thanks. I created separate WebRequests for each request using
WebRequest.Create(), and common underlying connection seems to be managed by
the .NET framework. I didn't explicitly tell .NET framework to use the same
connection for every requests. And it also looks like there is no way access
the underlying connection (opened by the .NET framework), to check if the
connection is closed or not before sending the request.

Shouldn't the .NET framework check if the connection is closed or not , then
open and use a new connection if it has been closed by web server before
sending a new request ? Checking this for every request and try again seems
to be a lot of typing overhead.

If .NET doesn't do that, is there any way to check if the underlying
connection is closed or not before sending the request?
 

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

Top