Original Post
Hey, I need to make a simple client server CHAT project in c++. When a client is connecting to a server, the server oppens a new thread and begins the communication with the client using this thread. When a client sending a string (chat msg) the server receives it and sends it to all the clients connected. Now my questions is this: if all the clients connected to the server in threads. how can i tell each thread to send a msg. I understand that the thread is a single function. Can i make the thread be a whole class? So i can have Thread.ListenFunc() constantly running and when the server needs to send a msgs to all the threads I'll call Thread.send(msg) from the main func. is it posibble?