Does any one knows an example for waiting for more than 64 sockets on a windows program.
If not, would dividing it into threads of a maximum of 64 sockets per thread work?
I basically need to implement a simple chat server with a maximum of around 1,000 users per machine with small packets with a maximum size of 1k. Besides ditching TCP and using UDP (which would bring its own set of troubles), what would be a good approach of doing this?
Use UDP :biggrin:
select allows you to check the state of a set of up-to 64 sockets at a time..
Call select for sockets 0-63, then call again for sockets 64-127, then again for the next 64...
But I'd consider changing to use async sockets with WSAAsyncSelect instead - you're supplied with a message when a socket needs attention, so there's no need for you to check.