The underlying connection was closed:...

  • Thread starter Thread starter amfi
  • Start date Start date
A

amfi

Hi

I have written a client application using WebRequest (HttpWebRequest) with
proxy server. I use it to send some data in XML to server. When the data
size is greater than 400-500 kB this error appears:

"The underlying connection was closed: An unexpected error occurred on a
receive."
StackTrace:" at System.Net.HttpWebRequest.CheckFinalStatus()
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.HttpWebRequest.GetResponse() ..."

Is there any solution to fix it?
Should I set KeepAlive to false?

Amfi
 
amfi,

It has nothing to do with your code, most likely. Rather, I think that
the server is timing out the request, and closing the response as a result.
For this, you will have to increase the time on the server that it takes to
receive a request.

Hope this helps.
 
Nicholas Paldino said:
amfi,

It has nothing to do with your code, most likely. Rather, I think that
the server is timing out the request, and closing the response as a result.
For this, you will have to increase the time on the server that it takes to
receive a request.

Hope this helps.

But timeout's values are really high (client - 10 minutes, server (Apache) -
10 minutes).
There is also a proxy server (ISA) but I'm not able to change any
configuration on it.
I've found something like that:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;819450
but it doesn't seem to work.
 
Back
Top