Search code examples
c#wcfservice

WCF: The socket connection was aborted


CommunicationException was unhandled by user code
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 '02:48:04.9840000'.

I've been testing this application for months and have just seen this error after making a small change to one of the services. It's only a few seconds, so I don't think it's a timeout issue.

InnerException: System.IO.IOException : The read operation failed, see inner exception

(Inner) InnerException: System.Net.Sockets.SocketException - An existing connection was forcibly closed by the remote host.

Any suggestions are greatly appreciated!

Thanks in advance


Solution

  • You are most likely running into quota issues like the MaxReceivedMessageSize, MaxArrayLength, MaxStringContentLength defined in the binding.

    You can also have a look at the MaxItemsInObjectGraph attribute available in the behaviors.