Hello,
Thanks for amazing library. I am going through the documentation at zguide. :)
I am at "
Shared Queue (DEALER and ROUTER sockets)".
The code of rrbroker.c has following code while sending multiple parts of the message from frontend to backend :
while (
1) {
// Process all parts of the message
zmq_msg_init (
&message);
zmq_msg_recv (
&message, frontend,
0);
int more
= zmq_msg_more (
&message);
zmq_msg_send (
&message, backend, more
? ZMQ_SNDMORE
: 0);
zmq_msg_close (
&message);
if (
!more)
break;
// Last message part
}My question is :
1. Is the while loop required to get 1 complete message ?
2. If we send message to `backend`, when their are multiple backends, would all messages be received by same backend ?
Looking on my own, i think answer is "Yes" for 1 and should be "Yes" for 2.
However, how is 2) implemented ? Where is this information stored about sending the next parts of the messages to a particular backend ?
I would not find anything in "msg_t" for this thing.
The questions may be simple (stupid.. ?) but please do give me some hints.
Thanks.