On Wed, Jan 18, 2012 at 7:51 AM, Chuck Remes <[email protected]> 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
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to