Im developing a program in C++ to run on my homecomputer and act as a server. I think it will be rather complicted to code efficiently. Basically what I want is to code a multi-threaded server which acts as a "lounge" for a game of coded. All clients should be allowed to connect to the server and chat with each other like an irc room. I also want some clients to be able to host games in the lounge so other users can join there game (the game is 2 player so the "host" and the "joiner" will be connected together not by the server).
Obviously I dont expect you to code it for me or even come with the protocol. Just the theory behind how the server should operare. I.E adding all clients to an array and continually looping through updating each one with the new info, i.e. a new game being hosted or someone typing a message to the whole lounge.
Also it would be good to know how I should implement error checking like if one of the hosts got kicked off the internet etc.
Thanks for any help :-)