I am working with ZeroMQ sockets (https://github.com/zeromq/jeromq) in Java
for the first time and I need to push my byte array to multiple socket
ports. I know how to send to one socket as shown below -
ZMQ.Context context = ZMQ.context(1);
ZMQ.Socket socket = context.socket(ZMQ.PUSH);
socket.connect("tcp://localhost:5700");
byte[] byteArray = generateRandomDataAsBytes();
ZMsg req = new ZMsg();
req.add(byteArray);
req.send(socket);
But how do I send to multiple socket ports? I need to connect to below
multiple ports and send the data as well -
tcp://localhost:5700
tcp://localhost:5701
tcp://localhost:5702
tcp://localhost:5703
What is the right way to do this using jeromq?
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev