I am to design a server that needs to serve millions of clients that are simultaneously connected with the server via TCP.
The data traffic between the server a
As Greg mentioned, the problem you are describing is C10K (or rather "C1M" in your case ) I recently made a simple TCP echo server on linux that scales very well with the number of sessions (only tested up to 200.000 though), by using the epoll queue. On BSD, you have something similar called kqueue. You can check out the code if you want to. Hope this helps and good luck!