[zeromq-dev] What is exactly an empty message

Majid Azimi azimi.majid at yahoo.com
Sun Feb 3 06:53:22 CET 2013

Hi guys,

I'm a bit confused with examples in Code Connected book. 
In the book when it want to send an empty message as delimiter frame it uses:

zmq_send(socket, "", 0, 0);

This is not an empty message. it has body the length is just zero. I thought an empty message is:

zmq_msg_t msg;
zmq_msg_send(&msg, socket, 0);

So what is exactly an empty message?

Second question is about ZMQ_SUBSCRIBE. The book uses zero length string "" as a filter to get all messages:

zmq_setsocketopt(socket, ZMQ_SUSCRIBE, "", 0);

But in web sites I have seen examples like this:

zmq_setsocketopt(socket, ZMQ_SUSCRIBE, NULL, 0);

It may be related to first question. Which one is correct? 

Thank you very much.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130202/b2676366/attachment.html>

More information about the zeromq-dev mailing list