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.
I found this example: https://github.com/grpc/grpc/pull/8934/files which is 
close to what I want, but it contains only one client connecting (If I'm 
not mistaken).

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.

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/74285ee2-2421-4db8-83b1-b11d1de1acb7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to