0MQ sends batch encoded packets of multiple messages. On Linux in the lingering state, i.e. flushing 0MQ sockets in zmq_term, 0MQ core drops (batch size - 1) messages from the last sent packet.
This can be witnessed with the PGM transport and remote_thr/local_thr testing. Send a sufficiently long sequence of messages and in the lingering state 0MQ only forwards the first messages of the last batch to the C++ socket wrapper.
Workaround in remote_thr is to send more messages than local_thr expects.