I'm using a ConsoleApplication
for a game server. I know this question has been asked before, but I'm looking for a work around. The server initializes all the data and then starts the acceptor manager which waits for clients. After this, it's basically done. Everything is running in the background so it just exists. So far I've used:
while (true)
Console.Read();
However, sometimes when an exception is thrown I want to shut down the server and show a message: Press any key to quit...
, but that's not possible because of the loop.
Is there a workaround for this?