Friday, June 13, 2014

[ Stack Overflow ] - c# - httpWebRequest (The underlying connection was closed: The connection was closed unexpectedly.)

In beginning coding in C# DotNet, we usually come across such errors, and it's good to look into them, see link below for more details

c# - httpWebRequest (The underlying connection was closed: The connection was closed unexpectedly.) - Stack Overflow

.NET has a bug where it expects that the server will include a Connection: close response header if it will close the connection after the response is complete. If the server closes the connection without the Connection: Close header (entirely valid per RFC2616), .NET will encounter the closed connection when attempting to send the next request on the connection and it will throw this exception. What .NET should be doing is silently creating a new connection and resending the request on that new connection.

No comments:

Know us

Our Team

Tags

Video of the Day

Contact us

Name

Email *

Message *