[zeromq-dev] zeromq2: problem with closing pollable socket

Vitaly Mayatskikh v.mayatskih at gmail.com
Fri Oct 23 09:57:20 CEST 2009


At Fri, 23 Oct 2009 08:52:18 +0200, Martin Sustrik wrote:

> > Btw, is it possible to do implicit flush for pollable socket in
> > zmq_close? Now it just hangs if any data was sent.
> 
> I don't follow. Can you describe what's actually happening and what do 
> you want to happen?

    ctx = zmq_init (1, 1, ZMQ_POLL);
    s = zmq_socket();
    rc = zmq_bind();
    zmq_poll(..., ZMQ_POLLOUT);
    zmq_send(..., ZMQ_NOBLOCK);
    zmq_close(); <-- blocks here forever

If there's zmq_flush() before zmq_close(), it doesn't block.
-- 
wbr, Vitaly



More information about the zeromq-dev mailing list