[zeromq-dev] Pub/Sub problem using sleep

Ineil zeromq at ineil.net
Mon Oct 29 09:18:23 CET 2012

I have recently started to evaluate 0MQ, and as part of this evaluation I was trying the Pub/Sub example (Weather update client & server) from the guide. I compiled the C++ version and everything appeared to work fine.

I then tried updating the server, to slow down its rate of transmission. I added a sleep(1) (I also tried nanosleep to give shorter delays) to the end of the main loop and this stopped things working. 

The server continues to go slowly round the main loop, but clients no longer receive messages. A WireShark trace shows that clients still connect and exchange a number of messages with the server, but the clients are never sent the weather update messages. 

I assume it is reasonable to put a delay in the main loop, hence I am assuming there is a problem somewhere here. 

If it is relevant, I have zeromq version 3.2.1 compiled and running on Ubuntu 12.04.

Any ideas. 

More information about the zeromq-dev mailing list