Windows limitation on number of simultaneously opened sockets/connections per machine

后端 未结 4 1751
青春惊慌失措
青春惊慌失措 2021-01-03 06:04

Let\'s say I have Windows 7 with one real network interface and few loopback interfaces. I have IOCP enabled server that accepts connections from clients. I\'m trying to sim

4条回答
  •  鱼传尺愫
    2021-01-03 06:10

    In your code example, you are calling Bind(bindEndpoint), but you do not show how bindEndpoint is defined. Check that :

    • Your system actually has multiple IP addresses (loopback does not count)
    • You are actually setting the IP Address of the endpoint to an IP address (not loopback)
    • The binds are being spread across multiple IP addresses

    The loopback address does not count because many systems treat it specially for routing and binding purposes. So binding to ports in loopback may be sucking up the ports across all addresses the same as if you were binding to INADDR_ANY (0.0.0.0).

提交回复
热议问题