[zeromq-dev] [Q] bind and connect multiple times

Pieter Hintjens ph at imatix.com
Sat May 15 21:49:50 CEST 2010


On Sat, May 15, 2010 at 9:32 PM, Chuck Remes <cremes.devlist at mac.com> wrote:

> I admit I don't understand how a socket can be a parameter to multiple bind or connect calls. Perhaps this makes sense to folks who have been using sockets for a long time, but most of my networking code has dealt with higher level abstractions so this is my first real exposure to the nitty-gritty details at the bottom.

So standard sockets are 1-to-1, whereas 0MQ creates n-to-n sockets.
This lets us implement messaging patterns in the socket layer (i.e. in
0MQ).  Standard sockets implement a single pattern (peer to peer)
where the network connection is the same thing as the socket.  0MQ
sockets abstract the connections (hide them) so that one socket can
exist as N connections, and as developer you don't really care.

0MQ adds the notion of socket type, defining what specific messaging
pattern you want to use at both ends (publishers and consumers).

Does this help?

-Pieter



More information about the zeromq-dev mailing list