zeromq

Can I safely have a sender use zmq_send and receiver use zmq_msg_recv?


I have one module where the developer used zmq_send and another module where the developer used zmq_msg_recv. These are supposed to talk to each other. As far as I can tell, zmq_send is just a wrapper around zmq_msg_send. Under the hood, everything uses zmq_msg_t type. I've written some test programs and everything seems to work, but I found some old Internet posts that suggest this might cause a problem.

Are there any known issues or corner cases that I'm going to hit where mixing these is a problem?


Solution

  • Yes its fine to use any of those functions together. They are doing the same work at a lower level, the only difference is how the message data is presented to the function

    zmq_msg_send/recv : uses zmq_msg_t as the payload

    zmq_send/recv : uses a pointer and length as the payload.