MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / send

Method send

modules/network/dns/dnsresolverudp.js:73–83  ·  view source on GitHub ↗
(request)

Source from the content-addressed store, hash-verified

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;

Callers 2

addMethod · 0.95
taskMethod · 0.95

Calls 4

addMethod · 0.95
buildMethod · 0.95
getMethod · 0.65
writeMethod · 0.65

Tested by

no test coverage detected