Hello,
I want to create in C++ a chat server: One serve to serve X clients at the same time, when a client sends a message, the server broadcast.
If I want multiple clients, do I need to create one stream per client (in a thread ?) or all the clients can use the same stream ?
If multiple streams it means I will have all threads waiting to read a message on their stream, and when someone receives one, the "main thread" after the call to "Next" will loop on all streams to write the message.
Is it possible to write a message on a stream while another thread is blocking on "Read" ?
If you have any advice to at least not let me go on a wrong direction, shout :)
Thanks.