Use of CyclicBarriers for ongoing communication between server and client(s)

53 Views Asked by At

I've set up sockets for communication between a server and client and have threads running on the server for multiple client connections. Furthermore I'm now sending byte arrays between server and client for data however I'm thinking of implementing cyclic barriers to make the server wait for a specific number of clients to connect before a different message is sent to each client.

This communication and waiting will need to be ongoing for example once this threshold of client connections is made and the message sent out, the server should now wait again for a message to come back from each client, probably a different message. This should continue for a few iterations at least, I'm wondering if I implement cyclic barriers for this process would i go be finding the best solution to this process?

Is this the intended use of cyclic barriers or would there be a better alternative to my idea?

To keep it simple, I intend to wait for 2 clients to connect. There will also be timeout conditions enforced to deal with possible failure.

0

There are 0 best solutions below