Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function onlistening () {
self._interval = setInterval(ontimeoutCheck, self.timeoutChecks)
self.emit('listening')
}
function onclose () {
self.emit('close')
}
}
util.inherits(DNS, events.EventEmitter)
DNS.RECURSION_DESIRED = DNS.prototype.RECURSION_DESIRED = packet.RECURSION_DESIRED
DNS.RECURSION_AVAILABLE = DNS.prototype.RECURSION_AVAILABLE = packet.RECURSION_AVAILABLE
DNS.TRUNCATED_RESPONSE = DNS.prototype.TRUNCATED_RESPONSE = packet.TRUNCATED_RESPONSE
DNS.AUTHORITATIVE_ANSWER = DNS.prototype.AUTHORITATIVE_ANSWER = packet.AUTHORITATIVE_ANSWER
DNS.AUTHENTIC_DATA = DNS.prototype.AUTHENTIC_DATA = packet.AUTHENTIC_DATA
DNS.CHECKING_DISABLED = DNS.prototype.CHECKING_DISABLED = packet.CHECKING_DISABLED
DNS.prototype.address = function () {
return this.socket.address()
}
DNS.prototype.bind = function (...args) {
const onlistening = args.length > 0 && args[args.length - 1]
if (typeof onlistening === 'function') {
this.once('listening', onlistening)
this.socket.bind(...args.slice(0, -1))
} else {
this.socket.bind(...args)
}
}
function onlistening () {
self._interval = setInterval(ontimeoutCheck, self.timeoutChecks)
self.emit('listening')
}
function onclose () {
self.emit('close')
}
}
util.inherits(DNS, events.EventEmitter)
DNS.RECURSION_DESIRED = DNS.prototype.RECURSION_DESIRED = packet.RECURSION_DESIRED
DNS.RECURSION_AVAILABLE = DNS.prototype.RECURSION_AVAILABLE = packet.RECURSION_AVAILABLE
DNS.TRUNCATED_RESPONSE = DNS.prototype.TRUNCATED_RESPONSE = packet.TRUNCATED_RESPONSE
DNS.AUTHORITATIVE_ANSWER = DNS.prototype.AUTHORITATIVE_ANSWER = packet.AUTHORITATIVE_ANSWER
DNS.AUTHENTIC_DATA = DNS.prototype.AUTHENTIC_DATA = packet.AUTHENTIC_DATA
DNS.CHECKING_DISABLED = DNS.prototype.CHECKING_DISABLED = packet.CHECKING_DISABLED
DNS.prototype.address = function () {
return this.socket.address()
}
DNS.prototype.bind = function (...args) {
const onlistening = args.length > 0 && args[args.length - 1]
if (typeof onlistening === 'function') {
this.once('listening', onlistening)
this.socket.bind(...args.slice(0, -1))
} else {
this.socket.bind(...args)
}
}
that.respond = function (res, rinfo, cb) {
if (Array.isArray(res)) res = {answers: res}
res.type = 'response'
res.flags = (res.flags || 0) | packet.AUTHORITATIVE_ANSWER
that.send(res, rinfo, cb)
}
that.respond = function (res, rinfo, cb) {
if (Array.isArray(res)) res = {answers: res}
res.type = 'response'
res.flags = (res.flags || 0) | packet.AUTHORITATIVE_ANSWER
that.send(res, rinfo, cb)
}
that.respond = function (res, rinfo, cb) {
if (Array.isArray(res)) res = {answers: res}
res.type = 'response'
res.flags = (res.flags || 0) | packet.AUTHORITATIVE_ANSWER
that.send(res, rinfo, cb)
}