[zeromq-dev] ZMQ_PAIR sockets in 3.x ZMQ / IPC in winows implementation
Pieter Hintjens
ph at imatix.com
Wed Jan 18 22:07:54 CET 2012
On Wed, Jan 18, 2012 at 7:51 AM, Chuck Remes <cremes.devlist at mac.com> wrote:
> ZMQ_PAIR sockets don't really fit in to the zeromq philosophy. Including them at all was probably a mistake.
I strongly disagree, finding them perfect for a quite common use case :-)
> I would expect that in the future, ZMQ_PAIR will be dropped.
Nooooooooo....
The use case is multithreading, as done in CZMQ. Child threads can be
"attached" to the main thread via a pipe, automatically created and
destroyed. These pipes are perfect for ZMQ_PAIR, since CZMQ is in full
control of the create/bind/connect flow. Using ZMQ_PAIR assures that
the pipes cannot be misused by accident or maliciously.
We _could_ drop PAIR quite trivially by using DEALER instead, if there
was a socket option to restrict the number of connecting peers (to 1
to emulate PAIR). But the PAIR semantics are clear and useful IMO.
-Pieter
More information about the zeromq-dev
mailing list