Connection aborted
I am getting this error when i am trying to upload a file of 3mb or more on my WCF client application.
SocketException (0x2745): An established connection was aborted by the software in your host machine]
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 established connection was aborted by the software in your host machine.]
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.WaitForReply(TimeSpan timeout) +54
[CommunicationException: An error occurred while receiving the HTTP response to http://localhost:4649/Service1.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.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +7596735
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +275
SmartConnectClient.SmartConnect.IService1.OrderCertMail(OrderCertMailResponse OrderCertMail1) +0
SmartConnectClient.SmartConnect.Service1Client.OrderCertMail(OrderCertMailResponse OrderCertMail1) in c:\documents and settings\pkale\my documents\visual studio 2008\projects\smartconnectclient\smartconnectclient\service references\smartconnect\reference.cs开发者_StackOverflow社区:1939
SmartConnectClient.Test_CertMail_Order.Page_Load(Object sender, EventArgs e) in C:\Documents and Settings\pkale\My Documents\Visual Studio 2008\Projects\SmartConnectClient\SmartConnectClient\Test_CertMail_Order.aspx.cs:40
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
You probably need to increase the quotas on the server binding and on the client binding. http://msdn.microsoft.com/en-us/library/ms731078.aspx
If the server is also a WCF service, to better diagnose things like this you can also enable WCF tracing at the server-side - and you'll get errors relating to things like transport quotas and other weird stuff appear in the service log (which you can view using the service log viewer that comes with the Service Trace Viewer that comes as part of the Windows SDK).
Sometimes you have to perform an IISReset or 'touch' the web.config of the service to force it to close the service trace file, otherwise the trace viewer can't see all the activity in the log.
ChecK:
http://weblogs.asp.net/paolopia/archive/2008/03/23/wcf-configuration-default-limits-concurrency-and-scalability.aspx
精彩评论