temp disable of direct mDNS responses

This commit is contained in:
tigerbot 2017-06-15 16:46:41 -06:00
parent 49d5e5296a
commit 8fb70564db
1 changed files with 8 additions and 6 deletions

View File

@ -137,13 +137,15 @@ module.exports.start = function (deps, config, mainPort) {
randomId.get().then(function (name) {
var resp = createResponse(name, packet, config.mdns.ttl, mainPort);
var now = Date.now();
if (now > nextBroadcast) {
// TODO: uncomment the lines below after the demo and fix the installer so that
// it can get the direct responses even on macOS.
// var now = Date.now();
// if (now > nextBroadcast) {
socket.send(resp, config.mdns.port, config.mdns.broadcast);
nextBroadcast = now + config.mdns.ttl * 1000;
} else {
socket.send(resp, rinfo.port, rinfo.address);
}
// nextBroadcast = now + config.mdns.ttl * 1000;
// } else {
// socket.send(resp, rinfo.port, rinfo.address);
// }
});
});