Best way to achieve this
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 :-)
It sounds like you haven't done any network programming before. This sounds like a fun project, but I would highly recommend you get your feet wet with network communication first.
Start with creating just a simple echo server first maybe. something the client can connect to and anything the client types is echoed back by the server. Then create a chat room server that can accept multiple clients and stuff people type in the room is sent to all the other clients.
You'll probably learn all you need to know if you can get those working and they can also serve as the base for the project you're actually working toward.