When we destroy a socket contained in a ZContext (zctx_t at czmq), it uses same linger of the ZContext. We can change the linger value. But if we want to change the linger for a specific socket only in the ZContext, it will not work.
The intention for the catch block is to ignore the ZMQ_TERM exception. This is a valid exception when a master ZContext calls term. Other exception must be handled. That's why the close is not in finally block. IMHO, I'm not a big fan of setting the linger at the destroy method. But we need to make an agreement with czmq to move other place. Thanks Min On Jan 22, 2013, at 5:37 AM, Trevor Bernard <[email protected]> wrote: > On the following line: > https://github.com/zeromq/jzmq/blob/master/src/org/zeromq/ZContext.java#L109 > > Should setLinger be set to 0 to immediately purge pending messages on > the socket upon close? Or is the currently functionality correct? > > Also in the same method, shouldn't the close and remove be wrapped in > a finally block? > https://github.com/zeromq/jzmq/blob/master/src/org/zeromq/ZContext.java#L115 > > https://github.com/zeromq/jzmq/issues/149 > _______________________________________________ > 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
