{"action":"created","issue":{"url":"https://api.github.com/repos/nickdesaulniers/node-nanomsg/issues/38","labels_url":"https://api.github.com/repos/nickdesaulniers/node-nanomsg/issues/38/labels{/name}","comments_url":"https://api.github.com/repos/nickdesaulniers/node-nanomsg/issues/38/comments","events_url":"https://api.github.com/repos/nickdesaulniers/node-nanomsg/issues/38/events","html_url":"https://github.com/nickdesaulniers/node-nanomsg/issues/38","id":52575718,"number":38,"title":"getting double message callback on BUS socket","user":{"login":"mango009","id":2007039,"avatar_url":"https://avatars.githubusercontent.com/u/2007039?v=3","gravatar_id":"","url":"https://api.github.com/users/mango009","html_url":"https://github.com/mango009","followers_url":"https://api.github.com/users/mango009/followers","following_url":"https://api.github.com/users/mango009/following{/other_user}","gists_url":"https://api.github.com/users/mango009/gists{/gist_id}","starred_url":"https://api.github.com/users/mango009/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mango009/subscriptions","organizations_url":"https://api.github.com/users/mango009/orgs","repos_url":"https://api.github.com/users/mango009/repos","events_url":"https://api.github.com/users/mango009/events{/privacy}","received_events_url":"https://api.github.com/users/mango009/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nickdesaulniers/node-nanomsg/labels/invalid","name":"invalid","color":"e6e6e6"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2014-12-20T20:31:49Z","updated_at":"2015-12-24T16:43:57Z","closed_at":"2015-04-12T07:51:51Z","body":"Do not know if this is the problem of my code or not but I seems to be getting double messages every time I call a send on a BUS socket:\r\n\r\nvar nano = require('nanomsg'),\r\n\targv = require('yargs').argv;\r\n\r\nvar bus = nano.socket('bus');\r\n\r\nvar addr = 'ipc:///tmp/' + argv.node;\r\nvar p1 = 'ipc:///tmp/' + argv.p1;\r\nvar p2 = 'ipc:///tmp/' + argv.p2;\r\n\r\nconsole.log('binding to', addr);\r\nbus.bind(addr);\r\n\r\nconsole.log('connecting to', p1);\r\nbus.connect(p1);\r\n//console.log('connecting to', p2);\r\n//bus.connect(p2);\r\n\r\nbus.on('message', function (buf) {\r\n    console.log(buf.toString());\r\n});\r\n\r\nvar seq = 0;\r\nsetInterval(function () {\r\n\tseq++;\r\n\tconsole.log('sending...', seq);\r\n    bus.send(argv.node + \" \" + seq);\r\n}, 5000);\r\n\r\n////////////////////////\r\nnode nano-test.js --node n0 --p1 n1\r\nnode nano-test.js --node n1 --p1 n0 \r\n\r\n///////////////////////\r\nn1 2\r\nn1 2\r\nsending... 1\r\nn1 3\r\nn1 3\r\nsending... 2\r\nn1 4\r\nn1 4\r\nsending... 3\r\nn1 5\r\nn1 5\r\n"},"comment":{"url":"https://api.github.com/repos/nickdesaulniers/node-nanomsg/issues/comments/167135702","html_url":"https://github.com/nickdesaulniers/node-nanomsg/issues/38#issuecomment-167135702","issue_url":"https://api.github.com/repos/nickdesaulniers/node-nanomsg/issues/38","id":167135702,"user":{"login":"nickdesaulniers","id":1823839,"avatar_url":"https://avatars.githubusercontent.com/u/1823839?v=3","gravatar_id":"","url":"https://api.github.com/users/nickdesaulniers","html_url":"https://github.com/nickdesaulniers","followers_url":"https://api.github.com/users/nickdesaulniers/followers","following_url":"https://api.github.com/users/nickdesaulniers/following{/other_user}","gists_url":"https://api.github.com/users/nickdesaulniers/gists{/gist_id}","starred_url":"https://api.github.com/users/nickdesaulniers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickdesaulniers/subscriptions","organizations_url":"https://api.github.com/users/nickdesaulniers/orgs","repos_url":"https://api.github.com/users/nickdesaulniers/repos","events_url":"https://api.github.com/users/nickdesaulniers/events{/privacy}","received_events_url":"https://api.github.com/users/nickdesaulniers/received_events","type":"User","site_admin":false},"created_at":"2015-12-24T16:43:57Z","updated_at":"2015-12-24T16:43:57Z","body":"> I want to help fix that\r\n\r\nCool, if you spot something wrong, we're always happy to review patches.\r\n\r\n> what the reason for this method?\r\n\r\nv8 does not expose a C API.  nanomsg and v8 can only be tied together through C++ (or [maybe now Rust](http://calculist.org/blog/2015/12/23/neon-node-rust/)) since v8's functions which we NEED for converting JS types to C types have C++ linkage and a C++ ABI."}}