TCP/IP failed to establish an outgoing connection because the selected local endpoint was recently used to connect to the same remote endpoint

Deshmukh, Pramod (Partner) 0 Reputation points
2024-06-28T18:32:13.78+00:00

TCP/IP failed to establish an outgoing connection because the selected local endpoint was recently used to connect to the same remote endpoint

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,575 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Yanhong Liu 4,815 Reputation points Microsoft Vendor
    2024-07-01T06:25:29.46+00:00

    Hello,

    Thank you for posting in Q&A forum.

    Based on your description, here are some possible solutions:

    1. Wait for a while: The easiest way is to wait for the TIME_WAIT state to end naturally. Depending on the system configuration, this may take several minutes.
    2. Reset the TCP/IP stack: You can use the command prompt to reset the TCP/IP stack to its default state. Please open the command prompt as an administrator and type the following command: "netsh int ip reset". Then, restart the computer.
    3. Use a different source port: If your application can dynamically select the source port, you can try to use a new unused source port each time you connect, so as to avoid those ports that are in the TIME_WAIT state.
    4. Check and solve problems at the network or application level: Frequent encounters with this problem may also mean that your application does not close the connection correctly, or there is an abnormality in the network environment. Check the network programming logic of the application to ensure that each connection is closed correctly and efficiently, and check whether there is any abnormal behavior caused by network equipment or firewalls.

    I hope the information above is helpful.

    Best Regards,

    Yanhong Liu

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments