[zeromq-dev] Can't bind same ZMQ_UP/DOWNSTREAM multiple times.

Jon Dyte jon at totient.co.uk
Sat Aug 21 09:00:30 CEST 2010

Oliver Smith wrote:
>   On 8/19/2010 5:10 PM, Jon Dyte wrote:
>> does this do what you want
> Yes :) Perfectly, thank you.

> It still seems like a duplication of work resulting from an artificial 
> imposition of an unrelated networking constraint.
yes but the zmq concept is that the pattern is the same when all in the 
same process or all of those
are single processes on the same box, or even different boxes?

> That is: because the networking concept of bind and connect, server and 
> client are being strictly enforced, you need an /additional worker/ (the 
> device) to bridge two communications channels that are only separated by 
> that imaginary concept.
> If the zmq_contexts were to ALWAYS take ownership of bound sockets and 
> then quietly join binders to them, then you could always have multiple 
> binds to an address regardless of protocol. You would, of course, not be 
> able to bind the same address across different contexts, but that then 
> begins to make sense.
>      ctx1 = zmq.Context(1)
>      ctx2 = zmq.Context(2)
>      s11, s12, s21 = ctx1.socket(zmq.DOWNSTREAM), 
> ctx1.socket(zmq.DOWNSTREAM), ctx2.socket(zmq.DOWNSTREAM)
>      addr = "inproc://address"
>      s11.bind(addr)    # ctx1 now owns the address.
>      s12.bind(addr)    # OK: Context owns the address.
>      s21.bind(addr)    # FAIL: Address already in use.
> _______________________________________________
> 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