[zeromq-dev] pausing polling sockets

Martin Sustrik sustrik at 250bpm.com
Thu Jan 27 08:51:53 CET 2011

Hi Michael,

> The prototype works very well and very fast, however, I am concerned
> about missing messages on disconnect. A disconnect can have several
> reasons: 1. Client Error/ Fault - client has to reload state. 2.
> Server Fault/Crash - client has to reload state from another server.
> 3. Network disconnect   - client can reload state but it would be
> nice for the client to reconnect to the same machine and resume where
> it left off. What happens if I stop the thread that is doing the
> polling on on the sub socket? If I resume it when the client
> reconnects will I get the messages that socket was subscribed for
> that were sent during the period the socket was not polled?

PUB/SUB is like a radio broadcast. If the radio receiver is off, you 
miss the show.

However, if the receiver is on, messages are received and queued 
asynchronously, even if zmq_recv() or zmq_poll() isn't being called at 
the moment.


More information about the zeromq-dev mailing list