I have 2 Windows Services. Each Windows Service is hosting a WCF Service.
ControllerService hosts ControllerWCF
CalcService hosts CalcWCF
There are few methods in ControllerWCF that will go towards CalcWCF to process some data. Then I have a third console application to test my services.
Using the third console application, to test it out I created 3 connections.
1st goes directly to the ControllerWCF which executes a method in ControllerWCF
2nd goes directly to the CalcWCF which executes a method in CalcWCF
3rd goes directly to the ControllerWCF which will execute a method in CalcWCF (same method as the 2nd connection)
When running the application, the 1st and 2nd connection will execute flawlessly. When going to the 3rd connection it will crash and return this exception message:
An existing connection was forcibly closed by the remote host
System.ServiceModel.Channels.SocketConnection.HandleReceiveAsyncCompleted()
System.ServiceModel.Channels.SocketConnection.OnReceiveAsync(Object sender, SocketAsyncEventArgs eventArgs)
System.Net.Sockets.SocketAsyncEventArgs.OnCompleted(SocketAsyncEventArgs e)
System.Net.Sockets.SocketAsyncEventArgs.FinishOperationAsyncFailure(SocketError socketError, Int32 bytesTransferred, SocketFlags flags)
System.Net.Sockets.SocketAsyncEventArgs.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
Also got this message error in the Service Trace Viewer
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 '10675199.02:48:05.4775807'.
- $exception {"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 '00:00:57.2419783'."} System.ServiceModel.CommunicationException
SocketException: An existing connection was forcibly closed by the remote host
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 '00:00:59.9989991'.
What I have tried:
I've activated the service trace, I've increased the timeouts, maxItemsInObjectGraph, etc etc.
I still don't know how to solve this problem. I will paste my app.config from all WCF Services soon.