Goal C, Best way to implement a chat application (socket)

I am trying to develop a chat application. I used AsyncSocket and followed the tutorial. So now I can get text msg from telnet using localhost.

But I do not know how to handle multiple chats. Let's say three different friends know my IP address and port number. They send me a message over the socket. Then how do I know which message belongs to those friends?

Thanks in advance.

+3
source share
1 answer

Use a different connection / socket for each friend or create a protocol for sending / receiving data in a chat that encapsulates not only the actual message body, but also the sender name, timestamp, etc.

+1
source

All Articles