Reputation: 26976
I have a Windows application that uses WCF service. It has some WCF service calls, and ClientBase.Close()
method is always called afterwards. When I close the application, I do not get any errors in it in VS2010. I've turned on all exceptions in the debugger and attached my compiler to everything I could. I am closing all connections, and no WCF service calls are running asynchronously when I am closing my app.
But I do get an exception on the WCF service!
The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was (some big number goes here).
The error code is 10054
And the inner exception is:
An existing connection was forcibly closed by the remote host.
But how could this happen to my code?
What can I do to find the reason of this erroneous behaviour?
Upvotes: 2
Views: 1355
Reputation: 2096
Turn on WCF tracing on the server, view the results with WCF trace viewer, make sure app pool has rights to directory with service ...
<system.diagnostics>
<sources>
<source name="System.ServiceModel"
switchValue="Verbose"
propagateActivity="true">
<listeners>
<add name="traceListener"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData="Events.evt" />
</listeners>
</source>
</sources>
<trace autoflush="true"/>
Upvotes: 1
Reputation: 63105
Increase the ChannelInitializationTimeout
Maximum time to wait for a connection to send the preamble during the initial read. This data is received before authentication occurs.
Default value is 5 sec. This is cause "An existing connection was forcibly closed by the remote host." exception.
Upvotes: 1