Comparing version 1.0.1 to 1.0.2
@@ -0,0 +0,0 @@ /*eslint no-console:0*/ |
@@ -0,0 +0,0 @@ /*eslint no-console:0*/ |
@@ -1,2 +0,1 @@ | ||
var debug = require('debug')('mdns:advertisement'); | ||
@@ -175,3 +174,3 @@ | ||
this.stop = function () { | ||
this.stop = function (next) { | ||
debug('unpublishing service'); | ||
@@ -181,3 +180,8 @@ internal.services = | ||
networking.send(pf.buildANPacket.apply(self, [0])); | ||
networking.send(pf.buildANPacket.apply(self, [0]), function () { | ||
networking.stop(); | ||
if (next) { | ||
next(); | ||
} | ||
}); | ||
this.nameSuffix = ''; | ||
@@ -184,0 +188,0 @@ this.alias = ''; |
@@ -0,0 +0,0 @@ var debug = require('debug')('mdns:lib:decoder'); |
@@ -165,5 +165,7 @@ var debug = require('debug')('mdns:lib:networking'); | ||
Networking.prototype.send = function (packet) { | ||
Networking.prototype.send = function (packet, next) { | ||
var buf = DNSPacket.toBuffer(packet); | ||
const netwk = this; | ||
this.connections.forEach(onEach); | ||
onSent(); | ||
debug('created buffer with length', buf.length); | ||
@@ -175,4 +177,5 @@ debugoutbound('message', buf.toString('hex')); | ||
// skip sending message on that interface. | ||
if (sock.address().address === '0.0.0.0' && !this.INADDR_ANY) { | ||
if (sock.address().address === '0.0.0.0' && !netwk.INADDR_ANY) { | ||
debug('skip send on pseudo interface.'); | ||
onSent(); | ||
} | ||
@@ -186,5 +189,16 @@ else { | ||
err); | ||
onSent(); | ||
}); | ||
} | ||
} | ||
var sent = -1; | ||
function onSent() { | ||
if (next !== undefined) { | ||
sent++; | ||
if (this.connections === undefined || sent === this.connections.length) { | ||
next(); | ||
} | ||
} | ||
} | ||
}; | ||
@@ -191,0 +205,0 @@ |
@@ -0,0 +0,0 @@ var debug = require('debug')('mdns:packetfactory'); |
@@ -0,0 +0,0 @@ |
{ | ||
"name": "mdns-js", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"repository": { | ||
@@ -15,19 +15,20 @@ "type": "git", | ||
"engines": { | ||
"node": ">= 8.0.0" | ||
"node": ">= 6.0.0" | ||
}, | ||
"main": "index.js", | ||
"dependencies": { | ||
"debug": "^3.1.0", | ||
"debug": "~3.1.0", | ||
"dns-js": "~0.2.1", | ||
"semver": "^5.4.1" | ||
"semver": "~5.4.1" | ||
}, | ||
"devDependencies": { | ||
"code": "^5.1.2", | ||
"eslint": "^4.11.0", | ||
"joi": "^13.0.2", | ||
"lab": "^15.1.2" | ||
"eslint": "^5.10.0", | ||
"joi": "^14.3.0", | ||
"lab": "^18.0.0" | ||
}, | ||
"scripts": { | ||
"test": "lab --flat && npm run lint", | ||
"lint": "eslint test examples lib index.js", | ||
"pretest": "node ./bin/testversion.js", | ||
"test": "./node_modules/.bin/lab --flat && npm run lint", | ||
"lint": "./node_modules/.bin/eslint test examples lib index.js", | ||
"doc": "jsdoc -d .\\doc index.js lib" | ||
@@ -34,0 +35,0 @@ }, |
@@ -0,0 +0,0 @@ mDNS-js |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1143
57220
+ Addeddebug@3.1.0(transitive)
+ Addedsemver@5.4.1(transitive)
- Removeddebug@3.2.7(transitive)
- Removedms@2.1.3(transitive)
- Removedsemver@5.7.2(transitive)
Updateddebug@~3.1.0
Updatedsemver@~5.4.1