Anthony Scemama
Anthony Scemama

Reputation: 1593

Which one is preferable : zmq_send or zmq_msg_send?

I am discovering zeroMQ, and I understand that zmq_send sends a buffer and zmq_msg_send sends a zmq_msg_t message. It seems to me that it is two different ways of doing the same thing (both can send multi-part messages, etc).

What are the advantages of using zmq_msg_t structs?

Upvotes: 2

Views: 2646

Answers (1)

user3666197
user3666197

Reputation: 1

Advantage is simply that your code works on a bit lower-level, closer to the metal, and saves a few CPU-cycles, that .zmq_send() wrapper spends on preparing the zmq_msg_t struct and passing it forward to the ZMQ-internal messaging processing as the .zmq_msg_send() does in one step.

Upvotes: 4

Related Questions