{"action":"created","issue":{"url":"https://api.github.com/repos/agnat/node_mdns/issues/124","labels_url":"https://api.github.com/repos/agnat/node_mdns/issues/124/labels{/name}","comments_url":"https://api.github.com/repos/agnat/node_mdns/issues/124/comments","events_url":"https://api.github.com/repos/agnat/node_mdns/issues/124/events","html_url":"https://github.com/agnat/node_mdns/issues/124","id":58149051,"number":124,"title":"Can't detect disconnect of devices","user":{"login":"joelongstreet","id":260920,"avatar_url":"https://avatars.githubusercontent.com/u/260920?v=3","gravatar_id":"","url":"https://api.github.com/users/joelongstreet","html_url":"https://github.com/joelongstreet","followers_url":"https://api.github.com/users/joelongstreet/followers","following_url":"https://api.github.com/users/joelongstreet/following{/other_user}","gists_url":"https://api.github.com/users/joelongstreet/gists{/gist_id}","starred_url":"https://api.github.com/users/joelongstreet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joelongstreet/subscriptions","organizations_url":"https://api.github.com/users/joelongstreet/orgs","repos_url":"https://api.github.com/users/joelongstreet/repos","events_url":"https://api.github.com/users/joelongstreet/events{/privacy}","received_events_url":"https://api.github.com/users/joelongstreet/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-19T00:00:25Z","updated_at":"2015-02-19T00:51:24Z","closed_at":null,"body":"First - sorry, I'm kind of new to mdns and networking in general. I'm attempting to detect when devices join and leave the network, but can't seem to get it figured out.\r\n\r\nWhy won't the below work? As I add and remove devices, I don't see any difference in the output from the logs. Even if the devices aren't connected to the network, i see the log with it's name and id.\r\n\r\nThanks for any help you can provide.\r\n\r\n    var mdns = require('mdns');\r\n    var browser = null;\r\n\r\n\r\n    var startBrowser = function(){\r\n      console.log('--------');\r\n      if(browser) browser.stop();\r\n\r\n      setTimeout(function(){\r\n        browser = mdns.createBrowser(mdns.tcp('googlecast'));\r\n\r\n        browser.on('serviceUp', function(service){\r\n          console.log('chromecast detected -', service.name, service.txtRecord.id);\r\n        });\r\n\r\n        browser.on('serviceDown', function(service){\r\n          console.log('chromecast lost', service);\r\n        });\r\n\r\n        browser.start();\r\n      }, 1000);\r\n    };\r\n\r\n\r\n    startBrowser();\r\n    setInterval(startBrowser, 5000);\r\n"},"comment":{"url":"https://api.github.com/repos/agnat/node_mdns/issues/comments/74980749","html_url":"https://github.com/agnat/node_mdns/issues/124#issuecomment-74980749","issue_url":"https://api.github.com/repos/agnat/node_mdns/issues/124","id":74980749,"user":{"login":"agnat","id":137545,"avatar_url":"https://avatars.githubusercontent.com/u/137545?v=3","gravatar_id":"","url":"https://api.github.com/users/agnat","html_url":"https://github.com/agnat","followers_url":"https://api.github.com/users/agnat/followers","following_url":"https://api.github.com/users/agnat/following{/other_user}","gists_url":"https://api.github.com/users/agnat/gists{/gist_id}","starred_url":"https://api.github.com/users/agnat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agnat/subscriptions","organizations_url":"https://api.github.com/users/agnat/orgs","repos_url":"https://api.github.com/users/agnat/repos","events_url":"https://api.github.com/users/agnat/events{/privacy}","received_events_url":"https://api.github.com/users/agnat/received_events","type":"User","site_admin":false},"created_at":"2015-02-19T00:51:24Z","updated_at":"2015-02-19T00:51:24Z","body":"Kind of hard to say...\r\n\r\nFirst, why do you mess around with timeouts and intervals? Just start one browser instance. Second, the `serviceDown` events have quite a long timeout. This is per spec and AFAIK there is no way to adjust that.\r\n\r\nHTH"}}