In Code Connected book volume 1(page 23) there is a example for using PUSH, PULL messaging. Before closing sockets it uses sleep(). Here is the code:
printf("Total expected cost: %d msec\n", total_msec);
sleep(1); // Give 0MQ time to deliver
zmq_close(sink);
zmq_close(sender);
zmq_ctx_destroy(context);
What is that sleep(1) about? Is this general rule?