WCF error on one server but not another: The socket connection was aborted

the socket connection was aborted net.tcp wcf
the socket connection was aborted eaglesoft
epicor the socket connection was aborted
the socket connection has been disposed
wcf service timeout server side
set-adfssslcertificate : the socket connection was aborted.
wcf timeout
wcf set timeout programmatically

I'm receiving this error when I call a WCF service reference (net.tcp://localhost:6256/CalculatorService/mex):

CalculatorServiceReference.AnswerResultClient client = new CalculatorServiceReference.AnswerResultClient("NetTcpBinding_IAnswerResult");
rtn = client.ServiceUpdate(org_int, sData); // ERROR HERE
client.Close();

In the server:

public interface IAnswerResult
{
    [OperationContract]
    bool ServiceUpdate(string org_int, string delimitedString);
}
public bool ServiceUpdate(string org_int, string delimitedString)
{
...
}

I have an identical server and service that works fine and I can't seem to find any difference. The error happens immediately, so it doesn't appear to be a timeout issue.

I tried the trace viewer but didn't see anything that's not here. I'm not even sure what else I can post to help understand what is happening. Any direction would be greatly appreciated.

The stack trace:

9/3/2018 7:52:44 AM:ERROR: System.ComponentModel.Win32Exception (0x80004005): The operation completed successfully
EternaService: 151 org192.168.100.2:6256151
System.ServiceModel.CommunicationException: 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:14:59.9969998'. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)
   --- End of inner exception stack trace ---

Server stack trace: 
   at System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)
   at System.ServiceModel.Channels.SocketConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
   at System.ServiceModel.Channels.DelegatingConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
   at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.SendPreamble(IConnection connection, ArraySegment`1 preamble, TimeoutHelper& timeoutHelper)
   at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.DuplexConnectionPoolHelper.AcceptPooledConnection(IConnection connection, TimeoutHelper& timeoutHelper)
   at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
   at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Call(ServiceChannel channel, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at CADEFileManager.CalculatorServiceReference.IAnswerResult.ServiceUpdate(String org_int, String delimitedString)
   at CADEFileManager.CalculatorServiceReference.AnswerResultClient.ServiceUpdate(String org_int, String delimitedString) in D:\Data\CADE.Net\FileManager\FileManager\Service References\CalculatorServiceReference\Reference.cs:line 67
   at CADEFileManager.FileManager.SendWCF(String org_int, String sData) in D:\Data\CADE.Net\FileManager\FileManager\FileManager.ashx.cs:line 9002

Well, I did another trace and found there are a number of references to timeouts. Does this mean anything new?

System.ServiceModel.Channels.SocketConnection.ConvertTransferException(SocketException socketException, TimeSpan timeout, Exception originalException, TransferOperation transferOperation, Boolean aborted, String timeoutErrorString, TransferOperation timeoutErrorTransferOperation, SocketConnection socketConnection, TimeSpan remainingTime)
System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)
System.ServiceModel.Channels.SocketConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
System.ServiceModel.Channels.DelegatingConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
System.ServiceModel.Channels.ConnectionStream.Read(Byte[] buffer, Int32 offset, Int32 count)
System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)
System.Net.Security.NegotiateStream.StartFrameHeader(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
System.Net.Security.NegotiateStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
System.Net.Security.NegotiateStream.Read(Byte[] buffer, Int32 offset, Int32 count)
System.ServiceModel.Channels.StreamConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.SendPreamble(IConnection connection, ArraySegment`1 preamble, TimeoutHelper& timeoutHelper)
System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.DuplexConnectionPoolHelper.AcceptPooledConnection(IConnection connection, TimeoutHelper& timeoutHelper)
System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout)
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Call(ServiceChannel channel, TimeSpan timeout)
System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)
System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
CADEFileManager.CalculatorServiceReference.IAnswerResult.ServiceUpdate(String org_int, String delimitedString)
CADEFileManager.CalculatorServiceReference.AnswerResultClient.ServiceUpdate(String org_int, String delimitedString)
CADEFileManager.FileManager.SendWCF(HttpContext context, String org_int, String sData)
CADEFileManager.FileManager.ProcessRequest(HttpContext context)

Try configuring "receiveTimeout" property for the binding.

<system.serviceModel>
    <bindings>
      <wsHttpBinding>
        <binding name="someBinding" receiveTimeout ="00:10:00">
          ...       
        </binding>
    </bindings>
  </system.serviceModel>

Also see "closeTimeout", "sendTimeout" and "openTimeout" properties of the Binding class.

[Solved] Socket Exception - WCF, The socket connection was aborted. that error you have is generic and generally hides another fault, not But in your case, your timeout is so close to a minute, I think you're hitting this limit: be taking longer the 1 minute to generate the server the response. If not the next step is to trace the actual call. Would you mind sharing your service-side? It seems that there is something wrong with the service running status. Please ensure that the binding configuration between the server-side and the client-side is consistent.

Have you checked if the port was open on that machine? Or maybe it is being used by another process?

You can try typing "netstat" in a command line interface to see the ports being used.

The socket connection was aborted. This could be , They have moved application from one windows server to other and keept This could be caused by an error processing your message or a Sockets.​SocketException: An existing connection was forcibly closed by the remote host Ours is definitely not timeout related as it happens immediately on the  System.servicemodel.communicationexception The Socket Connection Was Aborted connection was aborted. Produce Dürer's magic square Is the sum of minutes, and creates a file, and logs success).

I found the solution based on a comment in https://support.microsoft.com/en-us/help/896861/you-receive-error-401-1-when-you-browse-a-web-site-that-uses-integrate.

Windows Service Pack update includes a loopback check security feature that is designed to help prevent reflection attacks on your computer. Therefore, authentication fails if the FQDN or the custom host header that you use does not match the local computer name.

So, all I did was change the WCF link from localhost to the computer's name and it worked!!

WCF consumed by Web Farm Server. Error: The socket connection , I added tracing and this is the error I get: The socket connection was aborted. on other servers which arent on the web farm, but are on the same network and I am also This could be due to the fact that the server certificate is not configured​  It is quite possible that changing only one of these settings will work and it is also possible that changing these settings may have an adverse impact to your system. So, here is the section from my new config file:

Application Error The Socket Connection Was Aborted, We have to reboot the server when we get this error because nobody can We have been getting an application error "" The socket connection was aborted. Not sure if this applies, but make sure your system clocks are synchronized between the server and client. Customizations ? general WCF timeout configs. WCF Tracing showing "Socket Connection Aborted" warning.NET Framework > Serialization, and Networking. Windows Communication Foundation, Serialization,

The socket connection was aborted. This could be caused by an , This could be caused by an error processing your message or a receive timeout Due to importance of banking mobile and the growing demand of the use of However, one week before we simulated goin-live, the issue was not present. so that a WCF client can connect to a WCF server by doing any of the following:. Error: An existing connection was forcibly closed by the remote host Server stack trace: at System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)

The Socket connection was aborted, Hi All, I have one windows application and i have created a Self hosted WCF service to 20 hours and 30 minutes at Server side as well as client side config file. "The Socket connection was aborted. this could be caused by an error i am not able to generate the error on my development environment. WCF error: System.ServiceModel.CommunicationException: The socket connection was aborted I wrote my first WCF service recently which supported tcp as a transport protocol. During testing I faced a very strange problem.

Comments
  • What does your logging on he service side tell you? Did it get called? Did it produce a result? Did it finish the call? Was there any exception?
  • Sorry, should have mentioned, Server is never reached.
  • If it's never reached, something is wrong (or not as expected) with the hosting. How do you host them? Where is the difference between the servers, where do you set the different URLs for the client?
  • Both are VM's in same virtual data center, same OS's. URLs are set in the client when the Service Reference is created, using "net.tcp://localhost:6256/CalculatorService/mex". I started to add that service again and it does successfully find the service.
  • So they each go to their own machine?
  • I tried that (and for netTcpBinding) but no change. Using the debugger, the error is instant so it doesn't appear to be related to timing.. IMHO.
  • I did another trace and there are quite a few references to timeouts. I edited the original post with the trace... mean anything new?
  • Netstat shows the port 6256 "Listening" on 0.0.0.0:6256 and [::]:6256... I'm not sure what that last one means.