[zeromq-dev] UDP message with zeromq 2.0beta

Martin Sustrik sustrik at 250bpm.com
Thu Jan 21 11:05:33 CET 2010

Guo, Yanchao wrote:
> thanks Martin. I put it into a endless loop and I can see that there is 
> no packet drop for my local testing.
> Is there a way to flush the sending thread before program exist?

No there isn't. There are several reasons for that design:

1. Say you are using TCP transport, the connection is broken and there 
are 1000 messages queued for sending. Flushing would deadlock in such 

2. With PGM transport, even if you flush messages to the network, 
there's no guarantee that some packets won't get dropped (by switch or 
whatever networking device). While consumer may detect the lost and ask 
for retransmit, the sender will be closed once the retransmit request 
arrives. Thus, flushing the messages doesn't solve the problem anyway.


More information about the zeromq-dev mailing list