[zeromq-dev] inproc pub/sub socket connection
Pieter Hintjens
ph at imatix.com
Thu Nov 18 18:28:49 CET 2010
The guide is out of date specifically for inproc, which can work more easily
in 2.1.0 due to socket migration feature. Inproc does not auto-connect if
you bind after connect. So doing both in same thread is nice. I will fix the
guide once there is an official 2.1.0 release.
On 18 Nov 2010 18:08, "Chuck Remes" <cremes.devlist at mac.com> wrote:
>
> On Nov 18, 2010, at 11:00 AM, T-zex wrote:
>
>> Thank you Pieter,
>>
>> We are using 2.0.10, and trying to create a forwarder which forwards
>> messages from multiple threads to multiple subscribers. The forwarder
>> listens to multiple inproc publishers. This forwarder also implements
>> tcp subscriber coordination as described in the guide (through REQ REP
>> tcp sockets). Guide also states that sockets shold be created and used
>> in the same thread. I am bit confused now how to coordinate iproc
>> publishers.
>
> What is the specific confusion? An inproc endpoint can be treated the same
as an ipc or tcp endpoint.
>
> Your PUB/SUB forwarder can easily bind to an inproc endpoint *and* a tcp
endpoint and do its job. If you ever decide to move one or more publishers
out of the process space, the forwarder could bind to multiple inproc and
tcp endpoints. The publishers that you moved could then connect to the
"incoming" tcp endpoint while the publishers in process space continued to
connect to the same inproc endpoint.
>
> Forwarder...
>
> __________________
>
> inproc ---
> |
> Incoming
> |
> tcp ------
>
>
> tcp ------- Outgoing
>
> __________________
>
> My ascii art is probably terrible, but hopefully you get the idea.
>
> The same is true for a queue device used by the REQ/REP coordination
sockets.
>
> The lesson here is that a 0mq socket can bind (and connect) to multiple
endpoints of varying types.
>
> cr
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20101118/f8b09c99/attachment.htm>
More information about the zeromq-dev
mailing list