[zeromq-dev] Custom HWM behavior

Martin Sustrik sustrik at 250bpm.com
Sat Aug 20 08:40:18 CEST 2011

On 08/19/2011 07:08 PM, Ian Barber wrote:

> I think you have the tools you need in the API - look at the ZMQ_LINGER
> sockopt for termination, and for sending data you can either use send
> with the flag ZMQ_NOBLOCK to guarantee no blocking, or poll the socket
> first to see whether a message would block on send.


    s = zmq_socket (ZMQ_PUSH);
    if (zmq_send (s, msg, ZMQ_NOBLOCK) == EAGAIN)
        drop_message (msg);


More information about the zeromq-dev mailing list