[zeromq-dev] Send queue after socket close
Lindley French
lindleyf at gmail.com
Tue Jan 14 15:29:54 CET 2014
Perhaps I misinterpreted this sentence on the zmq_close() page:
"The default setting of *ZMQ_LINGER* does not discard unsent messages"
On Tue, Jan 14, 2014 at 8:47 AM, Pieter Hintjens <ph at imatix.com> wrote:
> On Tue, Jan 14, 2014 at 12:34 PM, Lindley French <lindleyf at gmail.com>
> wrote:
>
> > According to the docs, by default if a socket is closed, its send queue
> will
> > still be sent. However, the behavior I'm seeing casts some doubt on this.
>
> Where is this stated? Afaik the socket pipes (with messages) are
> destroyed when the socket is destroyed, which will wait for the LINGER
> time set on that socket, if there are messages waiting to be sent.
>
> > One practical solution would be for the ROUTER to send back a "THANKS"
> > message to the DEALER once it has everything, and not allow the socket to
> > close until then. I would like to understand the subtleties of the
> > implementation, though.
>
> Indeed, that's what you'd want to do. Closing the socket will drop an
> undefined messages in flight unless you set infinite linger, which can
> lead to your application blocking.
>
> -Pieter
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20140114/d24ceafc/attachment.htm>
More information about the zeromq-dev
mailing list