[zeromq-dev] Router-Dealer Example not working in C on 4.0.4 ZMQ release

Pieter Hintjens ph at imatix.com
Wed Jul 23 20:19:22 CEST 2014


There are no known issues, so it's presumably something in your
example. The best way to debug such uncertainties is to write a single
program that does all the work in one thread, e.g.

#include <czmq.h>

int main (void)
{
    zsock_t *router = zsock_new_router ("tcp://127.0.0.1:9990");
    zsock_t *dealer = zsock_new_dealer ("tcp://127.0.0.1:9990");

    zstr_send (dealer, "Hello World");
    zmsg_t *msg = zmsg_recv (router);
    zmsg_print (msg);
    zmsg_send (&msg, router);
    msg = zmsg_recv (dealer);
    zmsg_print (msg);

    zmsg_destroy (&msg);
    zsock_destroy (&router);
    zsock_destroy (&dealer);
    return 0;
}

(using CZMQ master with latest API calls)

On Wed, Jul 23, 2014 at 8:04 PM, Badhrinath Manoharan <badhrim at gmail.com> wrote:
> Hi Zero MQ Team,
>
> Zero MQ was introduced to me by one of my friends and was trying to get some
> hands on to it. I have been using C for my development. I have been trying
> to execute the examples provided by zeromq.
>
> Was able to get the REQ - REP, PUB - SUB and PUSH - PULL sockets working.
> However I was not able to get the
> REQ - ROUTER - DEALER - REP socket working. I just copy pasted the examples
> provided online
>
> rrclient: Request-reply client in C
> rrworker: Request-reply worker in C
> rrbroker: Request-reply broker in C
>
> I could see the REQ - ROUTER working. However a simple DEALER - REP socket
> does not seem to be working. I don't see the messages received by the REP
> socket. Are there any known issues regarding the ROUTER - DEALER socket.
> Could someone help me here?
>
> Thanks
> Badhri
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>



More information about the zeromq-dev mailing list