Examples of DnsQuestion


Examples of io.netty.handler.codec.dns.DnsQuestion

    ScheduledFuture<?> timeoutFuture() {
        return timeoutFuture;
    }

    void query() {
        final DnsQuestion question = this.question;

        if (remainingTries <= 0 || !nameServerAddresses.hasNext()) {
            parent.promises.set(id, null);

            int tries = maxTries - remainingTries;
View Full Code Here

Examples of io.netty.handler.codec.dns.DnsQuestion

                break;
            default:
                throw new Error();
            }

            query(parent.nameServerAddresses, new DnsQuestion(hostname, type));
        }
    }
View Full Code Here

Examples of io.netty.handler.codec.dns.DnsQuestion

        if (resolvedAddresses == null) {
            // .. and we could not find any A/AAAA records.
            if (!triedCNAME) {
                // As the last resort, try to query CNAME, just in case the name server has it.
                triedCNAME = true;
                query(parent.nameServerAddresses, new DnsQuestion(hostname, DnsType.CNAME, DnsClass.IN));
                return;
            }
        }

        // We have at least one resolved address or tried CNAME as the last resort..
View Full Code Here

Examples of io.netty.handler.codec.dns.DnsQuestion

        trace.append(": ");
        trace.append(name);
        trace.append(" CNAME ");
        trace.append(cname);

        query(parent.nameServerAddresses, new DnsQuestion(cname, DnsType.A, DnsClass.IN));
        query(parent.nameServerAddresses, new DnsQuestion(cname, DnsType.AAAA, DnsClass.IN));
    }
View Full Code Here

Examples of io.netty.handler.codec.dns.DnsQuestion

                if (questions.size() != 1) {
                    logger.warn("Received a DNS response with invalid number of questions: {}", res);
                    return;
                }

                final DnsQuestion q = qCtx.question();
                if (!q.equals(questions.get(0))) {
                    logger.warn("Received a mismatching DNS response: {}", res);
                    return;
                }

                // Cancel the timeout task.
View Full Code Here

Examples of io.netty.handler.codec.dns.DnsQuestion

        futures.put(unresolved, resolver.resolve(unresolved));
    }

    private static void queryMx(Map<String, Future<DnsResponse>> futures, String hostname) throws Exception {
        futures.put(hostname, resolver.query(new DnsQuestion(hostname, DnsType.MX)));
    }
View Full Code Here

Examples of io.vertx.core.dns.impl.netty.DnsQuestion

    bootstrap.connect(dnsServer).addListener(new RetryChannelFutureListener(result) {
      @Override
      public void onSuccess(ChannelFuture future) throws Exception {
        DnsQuery query = new DnsQuery(ThreadLocalRandom.current().nextInt());
        for (int type: types) {
          query.addQuestion(new DnsQuestion(name, type));
        }
        future.channel().writeAndFlush(query).addListener(new RetryChannelFutureListener(result) {
          @Override
          public void onSuccess(ChannelFuture future) throws Exception {
            future.channel().pipeline().addLast(new SimpleChannelInboundHandler<DnsResponse>() {
View Full Code Here

Examples of javax.jmdns.impl.DNSQuestion

                {
                    if (out == null)
                    {
                        out = new DNSOutgoing(DNSConstants.FLAGS_QR_QUERY);
                    }
                    out.addQuestion(new DNSQuestion(this.jmDNSImpl.getLocalHost().getName(), DNSConstants.TYPE_ANY, DNSConstants.CLASS_IN));

                    this.jmDNSImpl.getLocalHost().addAddressRecords(out, true);
                    this.jmDNSImpl.advanceState();
                }
                // send probes for services
                // Defensively copy the services into a local list,
                // to prevent race conditions with methods registerService
                // and unregisterService.
                List list;
                synchronized (this.jmDNSImpl)
                {
                    list = new LinkedList(this.jmDNSImpl.getServices().values());
                }
                for (Iterator i = list.iterator(); i.hasNext();)
                {
                    ServiceInfoImpl info = (ServiceInfoImpl) i.next();

                    synchronized (info)
                    {
                        if (info.getState() == taskState && info.getTask() == this)
                        {
                            info.advanceState();
                            logger.fine("run() JmDNS probing " + info.getQualifiedName() + " state " + info.getState());
                            if (out == null)
                            {
                                out = new DNSOutgoing(DNSConstants.FLAGS_QR_QUERY);
                                out.addQuestion(new DNSQuestion(info.getQualifiedName(), DNSConstants.TYPE_ANY, DNSConstants.CLASS_IN));
                            }
                            // the "unique" flag should be not set here because these answers haven't been proven unique yet
                            // this means the record will not exactly match the announcement record
                            out.addAuthorativeAnswer(new DNSRecord.Service(info.getQualifiedName(),
                                    DNSConstants.TYPE_SRV, DNSConstants.CLASS_IN, DNSConstants.DNS_TTL,
View Full Code Here

Examples of javax.jmdns.impl.DNSQuestion

            {
                if (count++ < 3)
                {
                    logger.finer("run() JmDNS querying type");
                    DNSOutgoing out = new DNSOutgoing(DNSConstants.FLAGS_QR_QUERY);
                    out.addQuestion(new DNSQuestion("_services._mdns._udp.local.", DNSConstants.TYPE_PTR, DNSConstants.CLASS_IN));
                    for (Iterator iterator = this.jmDNSImpl.getServiceTypes().values().iterator(); iterator.hasNext();)
                    {
                        out.addAnswer(new DNSRecord.Pointer("_services._mdns._udp.local.", DNSConstants.TYPE_PTR, DNSConstants.CLASS_IN, DNSConstants.DNS_TTL, (String) iterator.next()), 0);
                    }
                    this.jmDNSImpl.send(out);
View Full Code Here

Examples of javax.jmdns.impl.DNSQuestion

    public ServiceInfoResolver(JmDNSImpl jmDNSImpl, ServiceInfoImpl info)
    {
        this.jmDNSImpl = jmDNSImpl;
        this.info = info;
        info.setDns(this.jmDNSImpl);
        this.jmDNSImpl.addListener(info, new DNSQuestion(info.getQualifiedName(), DNSConstants.TYPE_ANY, DNSConstants.CLASS_IN));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.