intermittent unavailability of tcp wcf service with CommunicationException with Socket exception

Pranav Paruchuri 1 Reputation point
2021-11-22T07:30:59.84+00:00

We have been facing intermittent unavailability of the tcp wcf service for 3-4 secs every couple of days.

Existing conns at that time are close with a Communication Exception and the wcf trace logs mentions the following "The socket was aborted because an asynchronous receive from the socket did not complete within the allotted timeout of 00:02:00. The time allotted to this operation may have been a portion of a longer timeout".

The VMs of client and server are in the same azure VNET and we have a connection monitor checking for network connectivity showing no packet loss during the same time period.

What else can be checked to try resolving the above issue.

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,346 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Lan Huang-MSFT 25,386 Reputation points Microsoft Vendor
    2021-11-22T09:46:33.903+00:00

    Hi @Pranav Paruchuri ,
    You can try:
    1.Added these behaviors at both service and client config.

    <behaviors>  
    <endpointBehaviors>  
      <behavior name="endpointBehavior">  
        <dataContractSerializer maxItemsInObjectGraph="2147483647"/>  
      </behavior>  
    </endpointBehaviors>  
    </behaviors>  
    

    2.Update these values to maximum size in both Client and Server config.

    <binding name="tcpBinding" receiveTimeout="00:15:00" sendTimeout="00:15:00"  maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647">  
              <security mode="None">  
                <transport clientCredentialType="None" protectionLevel="None" />  
                <message clientCredentialType="None" />  
              </security>  
            </binding>  
    

    Best regards,
    Lan Huang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Pranav Paruchuri 1 Reputation point
    2022-01-09T08:54:37.197+00:00

    Hi @Lan Huang-MSFT ,

    Thank you for your response.

    We tried the above settings. But the issue seems to have come back.
    We captured the network traffic on both client and service side and we say the the Server(WCF) is sending a RST Packet to the clients.

    This is causing the above mentioned error. Based on the network captures we confirmed no out of order packets or other network drops have occurred. So not sure why WCF Server is generating this RST Packet.

    Any ideas.

    0 comments No comments