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.Sock ets.SocketExcep tion: An existing connection was forcibly closed by the remote host
Source Error:
Line 710: IWCFAdmin_Agent UserChannel _objChannel = null;
Line 711: _objChannel = WCFChannelFacto ry.GetChannel<I WCFAdmin_AgentU serChannel>(End pointInfo.WCFAd min_AgentUser.U RL, EndpointInfo.WC FAdmin_AgentUse r.Endpoint);
Line 712: objAgentUser = _objChannel.Sav eWithSchema(_ob jAgent, iSegmentAuthoId , iSchemaId);
Line 713: if (_objChannel != null && _objChannel.Sta te != CommunicationSt ate.Closed)
Line 714: _objChannel.Clo se();
Source File: c:\dev\Cataloni a_UI\App_Code\W CF_Wrapper_Admi n_AgentUser.cs Line: 712
Stack Trace:
[SocketException (0x2746): An existing connection was forcibly closed by the remote host]
System.Net.Sock ets.Socket.Rece ive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) +73
System.Net.Sock ets.NetworkStre am.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.Sock ets.NetworkStre am.Read(Byte[] buffer, Int32 offset, Int32 size) +294
System.Net.Pool edStream.Read(B yte[] buffer, Int32 offset, Int32 size) +26
System.Net.Conn ection.SyncRead (HttpWebRequest request, Boolean userRetrievedSt ream, Boolean probeRead) +297
[WebException: The underlying connection was closed: An unexpected error occurred on a receive.]
System.Net.Http WebRequest.GetR esponse() +5314029
System.ServiceM odel.Channels.H ttpChannelReque st.WaitForReply (TimeSpan timeout) +54
[CommunicationEx ception: An error occurred while receiving the HTTP response to http://localhost:8080/WCFAdmin_AgentU ser.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.Proxie s.RealProxy.Han dleReturnMessag e(IMessage reqMsg, IMessage retMsg) +7596735
System.Runtime. Remoting.Proxie s.RealProxy.Pri vateInvoke(Mess ageData& msgData, Int32 type) +275
Catalonia.Servi ceContract.IWCF Admin_AgentUser .SaveWithSchema (AgentUser _objAgent, Nullable`1 iSegmentAuthoId , Nullable`1 iSchemaId) +0
Catalonia.Wrapp er.WCF_Wrapper_ Admin_AgentUser .SaveWithSchema (AgentUser _objAgent, Nullable`1 iSegmentAuthoId , Nullable`1 iSchemaId) in c:\dev\Cataloni a_UI\App_Code\W CF_Wrapper_Admi n_AgentUser.cs: 712
Admin_UI_UserSe cEdit.SaveData( ) in c:\dev\Cataloni a_UI\UI_Admin\U serSecEdit.aspx .cs:918
Admin_UI_UserSe cEdit.btnSave_C lick(Object sender, EventArgs e) in c:\dev\Cataloni a_UI\UI_Admin\U serSecEdit.aspx .cs:786
System.Web.UI.W ebControls.Link Button.OnClick( EventArgs e) +111
System.Web.UI.W ebControls.Link Button.RaisePos tBackEvent(Stri ng eventArgument) +79
System.Web.UI.W ebControls.Link Button.System.W eb.UI.IPostBack EventHandler.Ra isePostBackEven t(String eventArgument) +10
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler sourceControl, String eventArgument) +13
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) +175
System.Web.UI.P age.ProcessRequ estMain(Boolean includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint) +1565
=============== =============== =============== ===========
thanks
in advance
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.Sock ets.SocketExcep tion: An existing connection was forcibly closed by the remote host
Source Error:
Line 710: IWCFAdmin_Agent UserChannel _objChannel = null;
Line 711: _objChannel = WCFChannelFacto ry.GetChannel<I WCFAdmin_AgentU serChannel>(End pointInfo.WCFAd min_AgentUser.U RL, EndpointInfo.WC FAdmin_AgentUse r.Endpoint);
Line 712: objAgentUser = _objChannel.Sav eWithSchema(_ob jAgent, iSegmentAuthoId , iSchemaId);
Line 713: if (_objChannel != null && _objChannel.Sta te != CommunicationSt ate.Closed)
Line 714: _objChannel.Clo se();
Source File: c:\dev\Cataloni a_UI\App_Code\W CF_Wrapper_Admi n_AgentUser.cs Line: 712
Stack Trace:
[SocketException (0x2746): An existing connection was forcibly closed by the remote host]
System.Net.Sock ets.Socket.Rece ive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) +73
System.Net.Sock ets.NetworkStre am.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.Sock ets.NetworkStre am.Read(Byte[] buffer, Int32 offset, Int32 size) +294
System.Net.Pool edStream.Read(B yte[] buffer, Int32 offset, Int32 size) +26
System.Net.Conn ection.SyncRead (HttpWebRequest request, Boolean userRetrievedSt ream, Boolean probeRead) +297
[WebException: The underlying connection was closed: An unexpected error occurred on a receive.]
System.Net.Http WebRequest.GetR esponse() +5314029
System.ServiceM odel.Channels.H ttpChannelReque st.WaitForReply (TimeSpan timeout) +54
[CommunicationEx ception: An error occurred while receiving the HTTP response to http://localhost:8080/WCFAdmin_AgentU ser.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.Proxie s.RealProxy.Han dleReturnMessag e(IMessage reqMsg, IMessage retMsg) +7596735
System.Runtime. Remoting.Proxie s.RealProxy.Pri vateInvoke(Mess ageData& msgData, Int32 type) +275
Catalonia.Servi ceContract.IWCF Admin_AgentUser .SaveWithSchema (AgentUser _objAgent, Nullable`1 iSegmentAuthoId , Nullable`1 iSchemaId) +0
Catalonia.Wrapp er.WCF_Wrapper_ Admin_AgentUser .SaveWithSchema (AgentUser _objAgent, Nullable`1 iSegmentAuthoId , Nullable`1 iSchemaId) in c:\dev\Cataloni a_UI\App_Code\W CF_Wrapper_Admi n_AgentUser.cs: 712
Admin_UI_UserSe cEdit.SaveData( ) in c:\dev\Cataloni a_UI\UI_Admin\U serSecEdit.aspx .cs:918
Admin_UI_UserSe cEdit.btnSave_C lick(Object sender, EventArgs e) in c:\dev\Cataloni a_UI\UI_Admin\U serSecEdit.aspx .cs:786
System.Web.UI.W ebControls.Link Button.OnClick( EventArgs e) +111
System.Web.UI.W ebControls.Link Button.RaisePos tBackEvent(Stri ng eventArgument) +79
System.Web.UI.W ebControls.Link Button.System.W eb.UI.IPostBack EventHandler.Ra isePostBackEven t(String eventArgument) +10
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler sourceControl, String eventArgument) +13
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) +175
System.Web.UI.P age.ProcessRequ estMain(Boolean includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint) +1565
=============== =============== =============== ===========
thanks
in advance