The underlying connection was closed:...

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
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 
A

amfi

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.
 

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