Are you positive that it's a reordering of messages, and not just dropped messages as in https://github.com/nanomsg/nanomsg/issues/283 ? On Fri, Jul 25, 2014 at 5:17 PM, Soren Riise <sorenriise@xxxxxxxxxxx> wrote: > Im seeing inproc messages being delivered in a different order than they > are sent, and was wondering if this is a feature or a bug. > > Using a git-cloned version 0.4, im having two threads pipeline data, as > (psudocode) > > nn_connect( sock = nn_socket(AF_SP, NN_PUSH), "inproc://abc") > while (data = moredata()) { > void *buf = nn_allocmsg(data.size(),0); > memcpy(buf, data.c_str(), data.size()); > nn_send(sock, &buf, NN_MSG, 0); > } > void *buf = nn_allocmsg(1,0); > buf.eof = true; > nn_send(sock, &buf, NN_MSG, 0); > > and the reciver; > > nn_bind( sock = nn_socket(AF_SP, NN_PULL), "inproc://abc") > while (nn_recv(sock, &buf, NN_MSG,0) != -1) { > if (buf.eof == true) > break; > nn_freemsg(buf); > } > > > However I see that messages are arriving in a different order than they > were sent, I basically see the EOF message which should be last being the > first message received -- if that is expected behavior it would warrant at > least a line of explanation in the documentation. > > Should I implement the pipeline in a different way if the ordering of data > is important? > > > Soren >