title: multiple publishers & subscribers in nanomsg (nng)
body: <p>How does one setup multiple publishers &amp; subscribers with a TCP transport. I suspect that you don't do automatic mesh/bus creation. So one needs a unique IP bind point for each publishers, right? They just have the subscribers connect to each publisher on a single socket.</p>
  
  <p>(this was discussed in: <a href="https://www.freelists.org/post/nanomsg/does-nanomsg-support-multi-producer-in-pubsub-mode,10" rel="nofollow noreferrer">https://www.freelists.org/post/nanomsg/does-nanomsg-support-multi-producer-in-pubsub-mode,10</a> )</p>
  
  <p>Is that basically correct?</p>
  
  <p>The reason I lean to a pub/sub over a bus/mesh approach is because (and I admit I might well be mistaken) - </p>
  
  <ul>
  <li>I don't need a fully connected mesh</li>
  <li>I figure your radix -tree filtering at each node is better than what I would come up with</li>
  <li>I like the "auto-discovery" aspect of pub/sub as opposed to the manual wiring of the mesh for the bus transports</li>
  <li>(i.e. automatic "entry and exit from mesh")</li>
  </ul>
  
  <p>Basically what I have is 2 producers (that mainly do publishing, but can receive occasional requests to put additional info on the stream being published, so they do need to listen)
  And then about five consumers who mainly do receipt of the data stream from the publishers, but do need to occasional send requests to the producers. </p>
  
  <p>And yes, I want the pub to be async, as as well as the recv() for the subscribe (no blocking is allowed in the context where I am using this).</p>
  
  <p>So this is a bi-directional pub/sub architecture. And I am looking at the simplest way to implement this. (traffic is pretty light).</p>
  
  <hr>
  
  <p>Of course a UDP transport would be nice for this, but I am not holding by breath.</p>