none
Socket returns 10060 (WSAETIMEDOUT) error with no network data exchange.

    Question

  • Hello,

    We are experiencing a strange issue with Sockets. We have a Windows 2012 R2 (latest updates) VM (VMWare ESXi) and software that uses .NET and Sockets to communicate with various web servers on Internet. System has two NIC cards. One is connected to Internet and one to Private network. On Private NIC we have about 2500 IPs assigned. Private NIC is used to communicate with Internet web servers using NAT. Public NIC has Windows NLB enabled VIP.
    Randomly (but we can reproduce the issue with test software almost constantly), for random target server IP and port, our application reports 10060 Socket error after calling ConnectEx Socket function. We are using async sockets from .NET. We have used Wireshark, Message Analyzer, socket tracing and observe the following:
    1. We bind socket to source IP (one of 2500 IPs on Private NIC). This is successful.

    2. We try to connect socket to a remote IP address and port, which calls ConnectEx internally.

    3. After 21 seconds, IO pending operation returns with 10060 error. During that time period no data exchange on network happens, e.g. socket doesn't try to connect with target server at all. Nothing is logged in traces, logs, etc. We confirmed no network data exchange using Wireshark and Message Analyzer. Both doesn't have anything related to target or source IPs used in socket.

    4. On the next attempt (after previous socket is closed), we have all working fine. Using same target IP and same Source IP (port changes probably, because we are using "0" during bind).

    5. If we stop our software and wait several minutes, we can observe the same problematic behavior. After initial failure (10060 error), system works normally. Then randomly same problem may re-appear for different target IP. Maybe it is related to that delay between socket operations, which causes trouble in our test case.

    We have also tried to enable WeakHostSend, but that didn't change anything:

    netsh interface ipv4 set interface [InterfaceNameOrIndex] weakhostsend=enabled

    Any help or clarification on this behavior is very much appreciated.

    Thank you.

    Wednesday, March 15, 2017 12:21 AM

All replies

  • Hi D_S_D,

    >Maybe it is related to that delay between socket operations, which causes trouble in our test case.

    According to your description, the socket error 10060 connection time out may occur at the first connection, seems it is a performance issue, maybe the first connection need more time to initialize. As a workaround, I'm thinking if we have a method to increase the timeout interval.

    Due to limited knowledge about how socket works, I would recommend you try MSDN forum which is code and development issues related, check if you can get better help there.

    Best Regards,

    Anne


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.



    Wednesday, March 15, 2017 7:36 AM
    Moderator
  • Thank you.
    I will try to seek help there.

    But I don't think this is a code issue. It might be some issue in Windows itself, as the same code works fine most of the time. And trouble happens inside Windows socket DLL, which just doesn't do any network connection and reports timeout error, not some other initialization errors.

    Thank you.

    Wednesday, March 15, 2017 8:26 AM
  • Hi D_S_D,

    Just to check if you get any progress with issue? Still welcome to feedback your information.

    Best Regards,

    Anne


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Monday, March 20, 2017 7:03 AM
    Moderator