Many tutorials on socket communication I see seem to use 1 thread per socket. But on a server used for online gaming, you might have 10k concurrent users - 10k threads isn t probably a wonderful idea. I came across a tool (SmartFox) which claims to use a single thread for monitoring all socket connections, potentially thousands of them. This app happens to be in Java, but I figure C++ or C# could do the same... how would you achieve this?
Is there a simple way to make sure that a local port is not already open. Some TCP socket servers (eg Grizzly) don t seem to do this check by default. When this check is missing, the server appears ...