Reputation: 8332
i develop an echo server with WSAEventSelect. It only allow 64 connections. What should i do.
Upvotes: 1
Views: 683
Reputation: 1
2.Use WSAAsyncSelect instead of WSAEventSelect and use Window messages instead
I would only go for WSAAsyncSelect in the client side for simple implementations, never for a server!!
Upvotes: 0
Reputation: 5111
There are 3 options:
The limit is imposed by the Kernel that a thread can wait to a maximum of 64 kernel objects in one WaitFor function.
Upvotes: 0
Reputation: 179917
Use more threads. Each thread can then handle 64 connections. It's quite possible to create 10-100 threads, depending on your hardware.
Upvotes: 0
Reputation: 41222
That sounds suspiciously like the MAXIMUM_WAIT_OBJECTS
limit, which is 64. The function WaitForMultipleObjectsEx is limited by that number. That link talks about solutions. If you are using WSAWaitForMultipleEvents, it might be this since the documentation says it calls WaitForForMultipleObjectsEx.
Upvotes: 3