I am working on a broadcast server where all clients should be able to send a broadcast message to all clients, and all clients should receive a broadcast from any client. I'm trying to figure out what the best way would be to implement this on the server side. I've run across a BlockingQueue
, but my understanding is that when one thread calls take()
, it removes the item so that the other threads can't get the data, and that each client is either a producer or a consumer. What would the best way be to implement this? Each client will have a thread on the server side.
Thanks!