Reputation: 31
I'm developing a multi room chat for a University Project, using C.
I managed to create a server, which listens to clients and everything works. But right now, what i made is a chat with a single room, and many clients can connect to it.
I have to change it: a client should be able to choose a room, where he has to be matched with a single client. Many clients can enter the same room, but can be matched only to one other client. To make it simple: if a room has 10 clients, and i get in, i should wait for someone to connect here too.
The problem is: i don’t know how to implement this. What is, exactly, ‘’a room’’? Is it another socket? So a client connets to the server’s socket, and then gets redirected to ANOTHER socket? Or should i use ports? I really don’t know what should be the best implementation here.
Upvotes: 1
Views: 942