Bind vs connect is independent of socket type. You can bind a SUB socket and connect many PUB sockets to it.
So, you could have each service bind a PUB socket and a SUB socket, and then connect each to all other services' SUB sockets and PUB sockets respectively. On Sunday, February 17, 2013 07:22:27 AM Lee Sylvester wrote: > Thank you for your reply, Witney, but I need it the other way. I need a sub > socket to be connected to multiple pub endpoints... This is because every > instance will have a single publisher, telling all who is interested about > events, but that same service will want to list to an arbitrary number of > other services for their events. Essentially, I'd be forming a type of > mesh, where each service has two endpoint (pub and sub) and all connect to > all. I knew pub could connect to many, as it binds, but I'm guessing the > subs cannot connect to many? > > Thanks loads, > Lee > > Sent from my iPhone > > On 17 Feb 2013, at 05:18, Whitney Jackson <[email protected]> wrote: > > > Is it possible for a sub socket to bind to multiple pub sockets? > > > > Yes. You can call bind and/or connect on a socket as many times at you > > like.> > > > If so, where is there an example of this? > > > > Here's an example from the guide where a pub socket is bound to multiple > > endpoints: > > > > http://zguide.zeromq.org/page:all#Getting-the-Message-Out > > > > If you connect a sub socket to multiple endpoints then it gets a message > > whenever any of the publishers to which it's connected send.> > > On Sat, Feb 16, 2013 at 4:18 PM, Lee Sylvester <[email protected]> wrote: > >> Hey guys, > >> > >> So, I want to do a many to many pubsub. I already have a discovery > >> mechanism and logging, but what I need is for a service to bind to a pub > >> socket and subscribe to a set list of instances of itself on the server > >> and other servers. The Zyre framework, although awesome, seems a little > >> large for my needs as I already have a number of the features it > >> supplies built in to my framework. Is it possible for a sub socket to > >> bind to multiple pub sockets? If so, where is there an example of this? > >> Can I also add a pub socket to listen to when all is already running? > >> > >> Thanks, > >> Lee > >> > >> > >> _______________________________________________ > >> zeromq-dev mailing list > >> [email protected] > >> http://lists.zeromq.org/mailman/listinfo/zeromq-dev > > > > _______________________________________________ > > zeromq-dev mailing list > > [email protected] > > http://lists.zeromq.org/mailman/listinfo/zeromq-dev _______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
