From e04bacd7257c120427466e90c895bebe772d26a9 Mon Sep 17 00:00:00 2001 From: Ben <43026681+bwp91@users.noreply.github.com> Date: Wed, 30 Sep 2020 01:31:32 +0100 Subject: [PATCH 1/2] catch dropMembership error --- lib/dns-sd.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/dns-sd.js b/lib/dns-sd.js index 0574f6e..a2921b4 100644 --- a/lib/dns-sd.js +++ b/lib/dns-sd.js @@ -430,7 +430,11 @@ DnsSd.prototype._addMembership = function () { DnsSd.prototype._dropMembership = function () { this._source_address_list.forEach((netif) => { - this._udp.dropMembership(this._MULTICAST_ADDR, netif); + try { + this._udp.dropMembership(this._MULTICAST_ADDR, netif); + } catch(e) { + console.log(`Catching error on dropMembership EADDRNOTAVAIL: ${JSON.stringify(e)}`); + } }); }; From 0babcfdd9a9512283df41f184e5f569e63f786fd Mon Sep 17 00:00:00 2001 From: Ben <43026681+bwp91@users.noreply.github.com> Date: Wed, 30 Sep 2020 01:37:14 +0100 Subject: [PATCH 2/2] Update dns-sd.js --- lib/dns-sd.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dns-sd.js b/lib/dns-sd.js index a2921b4..e97a4dd 100644 --- a/lib/dns-sd.js +++ b/lib/dns-sd.js @@ -433,7 +433,7 @@ DnsSd.prototype._dropMembership = function () { try { this._udp.dropMembership(this._MULTICAST_ADDR, netif); } catch(e) { - console.log(`Catching error on dropMembership EADDRNOTAVAIL: ${JSON.stringify(e)}`); + console.log(`Catching error on dropMembership: ${JSON.stringify(e)}`); } }); };