{"action":"created","issue":{"url":"https://api.github.com/repos/nanomsg/nng/issues/551","repository_url":"https://api.github.com/repos/nanomsg/nng","labels_url":"https://api.github.com/repos/nanomsg/nng/issues/551/labels{/name}","comments_url":"https://api.github.com/repos/nanomsg/nng/issues/551/comments","events_url":"https://api.github.com/repos/nanomsg/nng/issues/551/events","html_url":"https://github.com/nanomsg/nng/issues/551","id":335181805,"node_id":"MDU6SXNzdWUzMzUxODE4MDU=","number":551,"title":"Multiple Publishers & subscribers","user":{"login":"DrYSG","id":2865368,"node_id":"MDQ6VXNlcjI4NjUzNjg=","avatar_url":"https://avatars1.githubusercontent.com/u/2865368?v=4","gravatar_id":"","url":"https://api.github.com/users/DrYSG","html_url":"https://github.com/DrYSG","followers_url":"https://api.github.com/users/DrYSG/followers","following_url":"https://api.github.com/users/DrYSG/following{/other_user}","gists_url":"https://api.github.com/users/DrYSG/gists{/gist_id}","starred_url":"https://api.github.com/users/DrYSG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DrYSG/subscriptions","organizations_url":"https://api.github.com/users/DrYSG/orgs","repos_url":"https://api.github.com/users/DrYSG/repos","events_url":"https://api.github.com/users/DrYSG/events{/privacy}","received_events_url":"https://api.github.com/users/DrYSG/received_events","type":"User","site_admin":false},"labels":[{"id":498540337,"node_id":"MDU6TGFiZWw0OTg1NDAzMzc=","url":"https://api.github.com/repos/nanomsg/nng/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-24T14:02:40Z","updated_at":"2018-06-25T21:37:01Z","closed_at":null,"author_association":"NONE","body":"How does one setup multiple publishers & 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.\r\n\r\n(this was discussed in: https://www.freelists.org/post/nanomsg/does-nanomsg-support-multi-producer-in-pubsub-mode,10 )\r\n\r\nIs that basically correct?\r\n\r\nThe reason I lean to a pub/sub over a bus/mesh approach is because (and I admit I might well be mistaken) - \r\n\r\n- I don't need a fully connected mesh\r\n- I figure your radix -tree filtering at each node is better than what I would come up with\r\n- I like the \"auto-discovery\" aspect of pub/sub as opposed to the manual wiring of the mesh for the bus transports\r\n-  (i.e. automatic \"entry and exit from mesh\")\r\n\r\n\r\nBasically 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)\r\nAnd 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. \r\n\r\nAnd 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).\r\n\r\nSo this is a bi-directional pub/sub architecture. And I am looking at the simplest way to implement this. (traffic is pretty light).\r\n\r\n---\r\nOf course a UDP transport would be nice for this, but I am not holding by breath."},"comment":{"url":"https://api.github.com/repos/nanomsg/nng/issues/comments/400103923","html_url":"https://github.com/nanomsg/nng/issues/551#issuecomment-400103923","issue_url":"https://api.github.com/repos/nanomsg/nng/issues/551","id":400103923,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMDEwMzkyMw==","user":{"login":"DrYSG","id":2865368,"node_id":"MDQ6VXNlcjI4NjUzNjg=","avatar_url":"https://avatars1.githubusercontent.com/u/2865368?v=4","gravatar_id":"","url":"https://api.github.com/users/DrYSG","html_url":"https://github.com/DrYSG","followers_url":"https://api.github.com/users/DrYSG/followers","following_url":"https://api.github.com/users/DrYSG/following{/other_user}","gists_url":"https://api.github.com/users/DrYSG/gists{/gist_id}","starred_url":"https://api.github.com/users/DrYSG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DrYSG/subscriptions","organizations_url":"https://api.github.com/users/DrYSG/orgs","repos_url":"https://api.github.com/users/DrYSG/repos","events_url":"https://api.github.com/users/DrYSG/events{/privacy}","received_events_url":"https://api.github.com/users/DrYSG/received_events","type":"User","site_admin":false},"created_at":"2018-06-25T21:37:01Z","updated_at":"2018-06-25T21:37:01Z","author_association":"NONE","body":"Do tell me if I am bothering you too much. I can certainly find out the answers by experimentation. It was just my thought that I could ask a few focused questions, and perhaps that this would make it's way to a FAQ and perhaps also help the book.\r\n\r\nI do like the multiple endpoint approach (mix of PUB/SUB with a separate channel for REQ/REP). Can one also try two \"channels\" of pub/sub with one going in one direction and one in the other (I assume the answer is yes, here again, experimentation could tell me this).\r\n\r\nAlso I am still trying to wrap my mind around what the topology and listen/bind would look if I want two nodes each doing a publish protocol, with 5+ subscribers that are listening to both of them equally. \r\n\r\nLets assume server A: 192.168.0.0 and B: 192.168.0.1 Then I assume that the servers should use their unique endpoints IPs, and that the clients should dial twice. Once to one server and once to the other? \r\n\r\nFinally my code runs as plug-in DLL inside of a game engine that has a single thread main loop. I am a little coy in trying to do too much fancy stuff with thread pools, completion IOs etc.. I don't know how that would effect things. Although I do like what you illustrated in: https://github.com/nanomsg/nng/blob/master/demo/async/server.c with context aio structs. Very clean. Bless you.\r\n\r\nAnyway, I wanted to do something quick that I think would also work to deal with the blocking recv() calls. I see that polling is discouraged .poll(compat3) but what about getting the effect of a poll (my game loop runs at 60FPS) by adding a NNG_FLAG_NONBLOCK, to the .recv()?\r\n\r\nhttps://nanomsg.github.io/nng/man/v1.0.0/nng_recv.3.html\r\n\r\nFrom the documentation, it is not clear what the response if nothing is in the queue for the socket. But again, I could figure this out by trial and error. (but would be nice to put this in the documentation).\r\n\r\n"}}
{"actor":{"display_login":"DrYSG"}}