List of usage examples for io.netty.handler.codec.dns DnsResponseCode NOERROR
DnsResponseCode NOERROR
To view the source code for io.netty.handler.codec.dns DnsResponseCode NOERROR.
Click Source Link
From source file:io.vertx.core.dns.impl.fix.DnsNameResolverContext.java
License:Apache License
void onResponse(final DnsQuestion question, AddressedEnvelope<DnsResponse, InetSocketAddress> envelope) { try {//from w w w .j a v a 2 s . co m final DnsResponse res = envelope.content(); final DnsResponseCode code = res.code(); if (code == DnsResponseCode.NOERROR) { final DnsRecordType type = question.type(); if (type == DnsRecordType.A || type == DnsRecordType.AAAA) { onResponseAorAAAA(type, question, envelope); } else if (type == DnsRecordType.CNAME) { onResponseCNAME(question, envelope); } return; } if (traceEnabled) { addTrace(envelope.sender(), "response code: " + code + " with " + res.count(DnsSection.ANSWER) + " answer(s) and " + res.count(DnsSection.AUTHORITY) + " authority resource(s)"); } // Retry with the next server if the server did not tell us that the domain does not exist. if (code != DnsResponseCode.NXDOMAIN) { query(nameServerAddrs.next(), question); } } finally { ReferenceCountUtil.safeRelease(envelope); } }