Help with chat server model
I wrote a chat server and a client too.
The server uses the select() method to search for incoming messages.
When the client connected to the server , it can send /help command and this returns some other commands e.g /disconnect , /talk2 , /listusr .
Lets say now that in the server are connected 3 or more users.
The first idea is that whatever a user sends , the server resend it to all of the rest users. When the user uses the /talk2 <user> <message> command the message , will be send only to the selected user .This idea needs to use the select() in client too , to search for incoming and outcoming messages.
The second idea is this. Lets say we have 2 users on the server (john and peter). John wants to talk to peter and thats why he uses this command (talk2 peter). Then a new window (cmd) pops out and there peter can talk to john. I can't imagine how the new window can pop out and thats the difficulty of this idea.
So ... i need your ideas and your suggestions please. What you think i have to choose ? Can you suggest me an other way to achieve this project ?
Thanks in advance.