(request)
| 71 | } |
| 72 | } |
| 73 | send(request) { |
| 74 | const packet = new Serializer({query: true, recursionDesired: true, opcode: DNS.OPCODE.QUERY, id: request.id}); |
| 75 | packet.add(DNS.SECTION.QUESTION, request.host, DNS.RR.A, DNS.CLASS.IN); |
| 76 | |
| 77 | if (request.id) { |
| 78 | const dns = Net.get("DNS"); |
| 79 | this.socket.write(dns[request.state % dns.length], 53, packet.build()); |
| 80 | } |
| 81 | else |
| 82 | this.socket.write("224.0.0.251", 5353, packet.build()); |
| 83 | } |
| 84 | callback(message /*, value, address, port */) { |
| 85 | if (2 !== message) |
| 86 | return; |