I am useing wcf with c# below is the error i found when i try to save the record twice ,at first time it works fine. It is also reproduce randomly once for the second time i hit save next time for nth time
below is the description of error with stack trace , and piece of code which are having excetion.
================================================== =======
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 710: IWCFAdmin_AgentUserChannel _objChannel = null;
Line 711: _objChannel = WCFChannelFactory.GetChannel<IWCFAdmin_AgentUserCh annel>(EndpointInfo.WCFAdmin_AgentUser.URL, EndpointInfo.WCFAdmin_AgentUser.Endpoint);
Line 712: objAgentUser = _objChannel.SaveWithSchema(_objAgent, iSegmentAuthoId, iSchemaId);
Line 713: if (_objChannel != null && _objChannel.State != CommunicationState.Closed)
Line 714: _objChannel.Close();
Source File: c:\dev\Catalonia_UI\App_Code\WCF_Wrapper_Admin_Age ntUser.cs Line: 712
Stack Trace:
[SocketException (0x2746): An existing connection was forcibly closed by the remote host]
System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) +73
System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) +131
[IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.]
System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) +294
System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size) +26
System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead) +297
[WebException: The underlying connection was closed: An unexpected error occurred on a receive.]
System.Net.HttpWebRequest.GetResponse() +5314029
System.ServiceModel.Channels.HttpChannelRequest.Wa itForReply(TimeSpan timeout) +54
[CommunicationException: An error occurred while receiving the HTTP response to http://localhost:8080/WCFAdmin_AgentUser.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.]
System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage reqMsg, IMessage retMsg) +7596735
System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData& msgData, Int32 type) +275
Catalonia.ServiceContract.IWCFAdmin_AgentUser.Save WithSchema(AgentUser _objAgent, Nullable`1 iSegmentAuthoId, Nullable`1 iSchemaId) +0
Catalonia.Wrapper.WCF_Wrapper_Admin_AgentUser.Save WithSchema(AgentUser _objAgent, Nullable`1 iSegmentAuthoId, Nullable`1 iSchemaId) in c:\dev\Catalonia_UI\App_Code\WCF_Wrapper_Admin_Age ntUser.cs:712
Admin_UI_UserSecEdit.SaveData() in c:\dev\Catalonia_UI\UI_Admin\UserSecEdit.aspx.cs:9 18
Admin_UI_UserSecEdit.btnSave_Click(Object sender, EventArgs e) in c:\dev\Catalonia_UI\UI_Admin\UserSecEdit.aspx.cs:7 86
System.Web.UI.WebControls.LinkButton.OnClick(Event Args e) +111
System.Web.UI.WebControls.LinkButton.RaisePostBack Event(String eventArgument) +79
System.Web.UI.WebControls.LinkButton.System.Web.UI .IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +175
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
================================================== ======
thanks
in advance