Thanks Martin, I see. Maybe it would be option for future versions? It would make it much easier to write clean test code without aproox. waiting. Kind regards, Andi ________________________________________ From: [email protected] [[email protected]] On Behalf Of Martin Sustrik [[email protected]] Sent: Friday, February 25, 2011 12:55 PM To: ZeroMQ development list Cc: Zoufal Andreas Subject: Re: [zeromq-dev] Question to ZMQ_LINGER
Hi Andreas, > thanks for the new version with a lot of good new features. But I > have a question about ZMQ_LINGER. My test code breaks now at many > points or hang. Of course, I have to use ZMQ_LINGER now to avoid > zmq_term() to hang indefinitely for some tests, I read this in the > manual. But now I run into another problem. I repeat the sequence > (socket with linger option, bind, close) frequently, without send or > receive action. Now I get errors "Addreass already in use", I guess > because zmq_close() is not blocking for the lingering. > > Is there a way to synchronize (block) zmq_close() for thde pending > linger? zmq_close() is async, so only way to make sure that associated resources are closed is to close the whole context using zmq_term(). That operation blocks until all the sockets are fully closed. Martin _______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev _______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
