[zeromq-dev] inproc pub/sub socket connection

Chuck Remes cremes.devlist at mac.com
Thu Nov 18 19:14:57 CET 2010


On Nov 18, 2010, at 11:51 AM, T-zex wrote:

> What we have is:
> 
> inproc(a)---
>               |
>               Incoming(c)
>               |
> inproc(b)--
> 
> And the question is when we bind a and b and then do connect on c, is
> message delivery guaranteed form a and b to c? or do we need to do
> extra coordination?

As long as all sockets are bound/connected prior to the application sending any messages, then no messages will be lost. Messages from 'a' and 'b' will get to 'c' without any extra coordination.


> I understand about multiple types for endpoints, our concern is only
> inproc type.
> My guess is that inproc sockets are implemented very differently from
> tcp and there should be no lost messages on connect.

Under the covers the inproc endpoints are just flipping addresses around to "deliver" messages, so yes, they are implemented a bit differently. However, the semantics of the socket types (REQ/REP, PUB/SUB, etc) are unchanged. The only gotcha is the one Pieter mentioned where binding an inproc *after* another socket has connected to that endpoint doesn't work right (just bind the endpoint before any other socket connects and you'll be okay). Hopefully that will be fixed in 2.1+ so that the socket semantics are identical across all transport types.

cr




More information about the zeromq-dev mailing list