[zeromq-dev] Explicit control over socket buffers?
Pieter Hintjens
ph at imatix.com
Tue Jun 10 08:48:06 CEST 2014
It's the same reason TCP doesn't let you discard packets that are on
the wire. If you expose the internals of the plumbing to the
application then you cannot scale. It makes things considerably more
complex, and potentially slower by orders of magnitude. Even trying to
expose a concept like "how many messages are queued?" breaks things
(libzmq's pipes are filled and emptied asynchronously by two threads
and there is simply no way to measure the current state except by
freezing everything).
If you want explicit management of message queues, you build this on top.
-Pieter
On Mon, Jun 9, 2014 at 9:24 AM, Dmitry Antipov <antipov at dev.rtsoft.ru> wrote:
> Hello,
>
> why 0mq doesn't offer the facilities to control socket buffers (except
> setting send/receive watermarks and default socket policy to discard/block)?
> In particular, someone can ask about functions like 1) zmq_peek, to tell
> how many messages are buffered for input/output, and 2) zmq_discard, to
> discard all queued messages.
>
> It's quite possible that such a questions just illustrates some misunderstanding
> about what 0mq sockets are and how they should be used; but can someone explain
> the (obviously by-design) solution to _not_ provide these features?
>
> Thanks in advance,
> Dmitry
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
More information about the zeromq-dev
mailing list