I don't want to have a separate program for client and server so I have made my main game loop with a switch that determines if the process is running in server or client mode. The rest of the game is, of course, the same. The problem is that the SocketSeletor::Wait() on the server portion blocks the program flow.
What I have done is set the timeout to very low, I think 20 milliseconds, which allows my server process to run fine at 30fps. My game isn't processor intensive and so I won't have to worry about slowing the framerate that way. Is this an appropriate way to solve this problem? If I'm making a game in the future that can't wait around 20 milliseconds, what should I do? Is there a lower limit on this? Can I wait just 1 millisecond?
Thanks.