for sub/pub model, subscriber received msg include the code。
server code:
if((i % 2) == 0)
{
ZmqMsg workMsg("A workA" + i);
socket.send(workMsg);
}
if((i % 2) == 1)
{
ZmqMsg workMsg("B workB" + i);
socket.send(workMsg);
}
subscriber A received msg is
A workA0
...
subscriber B received msg is
B workB1
...
i hope subscriber A received msg is
workA0
...
subscriber B received msg is
workB1
...
i more hope server code like this:
if((i % 2) == 0)
{
socket.subscribe("A");
ZmqMsg workMsg("workA" + i);
socket.send(workMsg);
}
if((i % 3) == 1)
{
socket.subscribe("B");
ZmqMsg workMsg("workB" + i);
socket.send(workMsg);
}
thank you provide this lib。
for sub/pub model, subscriber received msg include the code。 server code: if((i % 2) == 0) { ZmqMsg workMsg("A workA" + i); socket.send(workMsg); } if((i % 2) == 1) { ZmqMsg workMsg("B workB" + i); socket.send(workMsg); } subscriber A received msg is A workA0 ... subscriber B received msg is B workB1 ...
i hope subscriber A received msg is workA0 ... subscriber B received msg is workB1 ...
i more hope server code like this: if((i % 2) == 0) { socket.subscribe("A"); ZmqMsg workMsg("workA" + i); socket.send(workMsg); } if((i % 3) == 1) { socket.subscribe("B"); ZmqMsg workMsg("workB" + i); socket.send(workMsg); }
can you modify it?