[zeromq-dev] Socket connect status

Martin Sustrik sustrik at 250bpm.com
Sat Mar 13 09:02:42 CET 2010


hi Andreas,

>  > The other possible problem is that you terminate the application before
>  > it has a chance to send the message. Note that 0MQ is a message queueing
>  > system, meaning that messages are sent asynchronously.
> 
> it seems that I have to wait before I close the socket. If I wait after 
> the close
> command, the message gets lost again. It would be great to have the 
> possibility
> to wait until all messages are sent, so that I can close the socket as 
> fast as
> possible without losing messages.

Pushing data to the network and exiting wouldn't still solve your 
problem. There's no guarantee that they'll be delivered and processed 
event then.

What you need is the other peer to confirm that everything is OK. Try 
using REQ/REP sockets and waiting for the reply before exiting.

Martin



More information about the zeromq-dev mailing list