Reputation: 1593
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
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