I was wondering if it would be a good idea to write the server side of a game with the following thought process:
1) Have a thread for listening for incoming connections.
2) Once we get a connection accept and start a new thread passing the file descriptor in as the parameter. At this point the player can create a new account or login to and existing one. Thread will then handle normal gameplay for that player. When player disconnects close the FD and end the thread.
3) Main thread will do the server side updating. Moving projectiles and AI controlled objects.
Is there a limit to how many threads you can have or should have? Would this be a viable design for a server / clients game? Or is there something fundamentally wrong?