| 55 | this.udp.add(DNSSD.IP); |
| 56 | } |
| 57 | close() { |
| 58 | while (this.services.length) |
| 59 | this.remove(this.services[0]); |
| 60 | |
| 61 | while (this.monitors.length) |
| 62 | this.remove(this.monitors[0].service.slice(0, this.monitors[0].service.length - 6)); |
| 63 | |
| 64 | this.claims.forEach(claim => { |
| 65 | Timer.clear(claim.timer); |
| 66 | Timer.clear(claim.initial); |
| 67 | }); |
| 68 | delete this.claims; |
| 69 | |
| 70 | this.udp?.close(); |
| 71 | delete this.udp; |
| 72 | } |
| 73 | write(buffer, address = DNSSD.IP, port = DNSSD.PORT) { |
| 74 | try { |
| 75 | this.udp.write(buffer, address, port); |