[zeromq-dev] zeromq dealer connecting to service

manju k m_a_n_j_u_s_k at yahoo.com
Tue May 6 14:44:03 CEST 2014


I am new to zeromq and going through the zeromq guide. My query is with Shared Queue (dealer router sockets). Specifically in the example quoted in the document under section Shared Queue (http://zguide.zeromq.org/page:all#Shared-Queue-DEALER-and-ROUTER-sockets)

In the example code "rrbroker: Request-reply broker in C"

void *frontend = zmq_socket (context, ZMQ_ROUTER);
void *backend = zmq_socket (context, ZMQ_DEALER);
zmq_bind (frontend, "tcp://*:5559");
zmq_bind (backend, "tcp://*:5560");
if (items [0].revents & ZMQ_POLLIN) {
    while (1) {
            zmq_msg_recv (&message, frontend, 0);
            zmq_msg_send (&message, backend, more? ZMQ_SNDMORE: 0);

If there is a message received on router socket, it is passed on to the server node using the dealer socket. But in this case I did not understand how does the dealer socket know to which IP/port to connect to deliver the message. Bit confused here.

Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20140506/19a4e706/attachment.htm>

More information about the zeromq-dev mailing list