Urgent error :An existing connection was forcibly closed by the remote host

Feb 14, 2008 at 11:24 AM
Im getting this error sometimes fom my application

can anybody help??



An existing connection was forcibly closed by the remote host
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

Source Error:
Line 66: base.Secret = ConfigurationManager.AppSettings"secret";
Line 67:
Line 68: base.Page_Load(sender, e);
Line 69:
Line 70: if (!IsPostBack)



Thanks

Mido
Feb 27, 2008 at 11:26 AM

I have same problem - any ideas?

Error Message: An existing connection was forcibly closed by the remote host
Stack Trace:
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
Mar 19, 2008 at 2:08 PM
any news on this one... comes daily.
Mar 19, 2008 at 2:23 PM
Edited Jun 19, 2008 at 12:56 PM
no news?

Mar 26, 2008 at 11:03 AM
I found reply that GetQueryResponse needs to be edited like this -- is there someone who could do the change and update the DLL for me.. I dont have C# available, only VBasic.


internal static string GetQueryResponse(string requestUrl, string postString)
{
int tries = 0;
bool success = false;
string responseData = null;
Exception lastException = null;
while (tries++ < 3 && !success)
{
try
{
// Create a web request for input path.
WebRequest webRequest = WebRequest.Create(requestUrl);
webRequest.Method = "POST";
webRequest.ContentType = "application/x-www-form-urlencoded";

if (!String.IsNullOrEmpty(postString))
{
byte[] parameterString = Encoding.ASCII.GetBytes(postString);
webRequest.ContentLength = parameterString.Length;

using (Stream buffer = webRequest.GetRequestStream())
{
buffer.Write(parameterString, 0, parameterString.Length);
buffer.Close();
}
}

using (WebResponse webResponse = webRequest.GetResponse())
{
using (StreamReader streamReader = new StreamReader(webResponse.GetResponseStream()))
{
responseData = streamReader.ReadToEnd();
}
}
success = true;
}
catch (Exception e)
{
lastException = e;
}
}
if (!success)
throw (lastException);
return responseData;
}