From the ZMQ FAQ:
How can I flush all messages that are in the ZeroMQ socket queue? There is no explicit command for flushing a specific message or all messages from the message queue. You may set
ZMQ_LINGERto0and close the socket to discard any unsent messages.