{"action":"created","issue":{"url":"https://api.github.com/repos/nickdesaulniers/node-nanomsg/issues/156","repository_url":"https://api.github.com/repos/nickdesaulniers/node-nanomsg","labels_url":"https://api.github.com/repos/nickdesaulniers/node-nanomsg/issues/156/labels{/name}","comments_url":"https://api.github.com/repos/nickdesaulniers/node-nanomsg/issues/156/comments","events_url":"https://api.github.com/repos/nickdesaulniers/node-nanomsg/issues/156/events","html_url":"https://github.com/nickdesaulniers/node-nanomsg/issues/156","id":158499070,"number":156,"title":"Pub/Sub stops after first message has been received.","user":{"login":"janflyborg","id":12851853,"avatar_url":"https://avatars.githubusercontent.com/u/12851853?v=3","gravatar_id":"","url":"https://api.github.com/users/janflyborg","html_url":"https://github.com/janflyborg","followers_url":"https://api.github.com/users/janflyborg/followers","following_url":"https://api.github.com/users/janflyborg/following{/other_user}","gists_url":"https://api.github.com/users/janflyborg/gists{/gist_id}","starred_url":"https://api.github.com/users/janflyborg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janflyborg/subscriptions","organizations_url":"https://api.github.com/users/janflyborg/orgs","repos_url":"https://api.github.com/users/janflyborg/repos","events_url":"https://api.github.com/users/janflyborg/events{/privacy}","received_events_url":"https://api.github.com/users/janflyborg/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nickdesaulniers/node-nanomsg/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":29,"created_at":"2016-06-04T10:39:47Z","updated_at":"2016-06-27T14:00:39Z","closed_at":null,"body":"I am absolutely new to nanomsg, so I might be doing something really stupid, but I can't get this simple PUBSUB example to work:\r\n\r\n```javascript\r\nvar nano = require('nanomsg');\r\nvar addr = 'tcp://127.0.0.1:7789'\r\n\r\nvar pub = nano.socket('pub');\r\npub.bind(addr);\r\n\r\nvar sub1 = nano.socket('sub');\r\nsub1.on('data', function (buf) {\r\n  console.log('sub1:' + String(buf));\r\n});\r\nsub1.chan(['topic1'])\r\nsub1.connect(addr);\r\n\r\nvar sub2 = nano.socket('sub');\r\nsub2.on('data', function (buf) {\r\n  console.log('sub2:' + String(buf));\r\n});\r\nsub2.chan(['topic2'])\r\nsub2.connect(addr);\r\n\r\nsetInterval(function () {\r\n    console.log('sending');\r\n    pub.send(\"topic1 Hello from nanomsg!\");\r\n    console.log('sent');\r\n}, 1000);\r\n```\r\nRunning this gives me:\r\n\r\n```\r\nsending\r\nsent\r\nsub1:topic1 Hello from nanomsg!\r\n```\r\n\r\nAnd then there is nothing more (even if the node process does not exit). I would expect the setInterval to do this repeatedly, but after the first message has been received there is nothing more.\r\n\r\nAny ideas? I have tried this on nodejs 5.11.0 on my Mac and on 6.2.0 on an Ubuntu machine."},"comment":{"url":"https://api.github.com/repos/nickdesaulniers/node-nanomsg/issues/comments/228753897","html_url":"https://github.com/nickdesaulniers/node-nanomsg/issues/156#issuecomment-228753897","issue_url":"https://api.github.com/repos/nickdesaulniers/node-nanomsg/issues/156","id":228753897,"user":{"login":"reqshark","id":937826,"avatar_url":"https://avatars.githubusercontent.com/u/937826?v=3","gravatar_id":"","url":"https://api.github.com/users/reqshark","html_url":"https://github.com/reqshark","followers_url":"https://api.github.com/users/reqshark/followers","following_url":"https://api.github.com/users/reqshark/following{/other_user}","gists_url":"https://api.github.com/users/reqshark/gists{/gist_id}","starred_url":"https://api.github.com/users/reqshark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reqshark/subscriptions","organizations_url":"https://api.github.com/users/reqshark/orgs","repos_url":"https://api.github.com/users/reqshark/repos","events_url":"https://api.github.com/users/reqshark/events{/privacy}","received_events_url":"https://api.github.com/users/reqshark/received_events","type":"User","site_admin":false},"created_at":"2016-06-27T14:00:39Z","updated_at":"2016-06-27T14:00:39Z","body":"@alimousazy, could you send a PR?"}}
{"actor":{"display_login":"reqshark"}}