[zeromq-dev] prevent msg caching

Whit Armstrong armstrong.whit at gmail.com
Wed Sep 28 04:09:36 CEST 2011

I'm testing an R package for zmq.

I'm using push/pull and I would like to prevent messages from being
cached at the receiver while I'm debugging the package.

I've tried the following:

    uint64_t hwm = 0;
    zmq_setsockopt (receiver, ZMQ_HWM, &hwm, sizeof (hwm));

    uint64_t swap = 0;
    zmq_setsockopt (receiver, ZMQ_SWAP, &swap, sizeof (swap));

However, as soon as I call zmq_connect on the pull socket (the
receiver), the push socket sends 100s of messages before I even make
the first call to zmq_recv.  If I let the app run without calling
zmq_recv at all on the pull socket I can see the memory slowly build
on the receiver process.

So, my question is what other zmq options (or kernel options) do I
need to set to prevent the sender from sending (and prevent the
receiver from caching) while I debug the app?

I'm happy to post my test cases to the list.  It's basically a slimmed
down version of the ventilator example.


More information about the zeromq-dev mailing list