I have been using zeromq for some time and use multipart message extensively. In C++, I use zmq_sendiov/zmq_recviov to send/recv multipart message. The benefit is I can put each message 'frame' in one iovec, and use the call to send/recv in one go.
Recently I decide to give nanomsg a try, I realize nanomsg has nn_sendmsg/nn_sendmsg which also use iovec. The question is: does nanomsg make sure that the structure of the iovec that is received being the same as the one gets sent? e.g., suppose I put
msg[0].iov_base = "Hello";
msg[0].iov_len = 5;
msg[1].iov_base = "World";
msg[1].iov_len = 5;
and send, will the receiving end get the same iovec array, with "Hello" and "World" in each element, or nanomsg is free to reassemble the buffer?
Thanks Ralph
nanomsg-1.0.0 already support iov nn_sendmsg