Set<DNSRecord> answers = new HashSet<DNSRecord>(); if (this.getDns().isAnnounced()) { try {
@Override public void start(Timer timer) { long now = System.currentTimeMillis(); if (now - this.getDns().getLastThrottleIncrement() < DNSConstants.PROBE_THROTTLE_COUNT_INTERVAL) { this.getDns().setThrottle(this.getDns().getThrottle() + 1); } else { this.getDns().setThrottle(1); } this.getDns().setLastThrottleIncrement(now); if (this.getDns().isAnnounced() && this.getDns().getThrottle() < DNSConstants.PROBE_THROTTLE_COUNT) { timer.schedule(this, JmDNSImpl.getRandom().nextInt(1 + DNSConstants.PROBE_WAIT_INTERVAL), DNSConstants.PROBE_WAIT_INTERVAL); } else if (!this.getDns().isCanceling() && !this.getDns().isCanceled()) { timer.schedule(this, DNSConstants.PROBE_CONFLICT_INTERVAL, DNSConstants.PROBE_CONFLICT_INTERVAL); } }
@Override public void start(Timer timer) { long now = System.currentTimeMillis(); if (now - this.getDns().getLastThrottleIncrement() < DNSConstants.PROBE_THROTTLE_COUNT_INTERVAL) { this.getDns().setThrottle(this.getDns().getThrottle() + 1); } else { this.getDns().setThrottle(1); } this.getDns().setLastThrottleIncrement(now); if (this.getDns().isAnnounced() && this.getDns().getThrottle() < DNSConstants.PROBE_THROTTLE_COUNT) { timer.schedule(this, JmDNSImpl.getRandom().nextInt(1 + DNSConstants.PROBE_WAIT_INTERVAL), DNSConstants.PROBE_WAIT_INTERVAL); } else if (!this.getDns().isCanceling() && !this.getDns().isCanceled()) { timer.schedule(this, DNSConstants.PROBE_CONFLICT_INTERVAL, DNSConstants.PROBE_CONFLICT_INTERVAL); } }
@Override public void start(Timer timer) { long now = System.currentTimeMillis(); if (now - this.getDns().getLastThrottleIncrement() < DNSConstants.PROBE_THROTTLE_COUNT_INTERVAL) { this.getDns().setThrottle(this.getDns().getThrottle() + 1); } else { this.getDns().setThrottle(1); } this.getDns().setLastThrottleIncrement(now); if (this.getDns().isAnnounced() && this.getDns().getThrottle() < DNSConstants.PROBE_THROTTLE_COUNT) { timer.schedule(this, JmDNSImpl.getRandom().nextInt(1 + DNSConstants.PROBE_WAIT_INTERVAL), DNSConstants.PROBE_WAIT_INTERVAL); } else if (!this.getDns().isCanceling() && !this.getDns().isCanceled()) { timer.schedule(this, DNSConstants.PROBE_CONFLICT_INTERVAL, DNSConstants.PROBE_CONFLICT_INTERVAL); } }
@Override public void start(Timer timer) { long now = System.currentTimeMillis(); if (now - this.getDns().getLastThrottleIncrement() < DNSConstants.PROBE_THROTTLE_COUNT_INTERVAL) { this.getDns().setThrottle(this.getDns().getThrottle() + 1); } else { this.getDns().setThrottle(1); } this.getDns().setLastThrottleIncrement(now); if (this.getDns().isAnnounced() && this.getDns().getThrottle() < DNSConstants.PROBE_THROTTLE_COUNT) { timer.schedule(this, JmDNSImpl.getRandom().nextInt(1 + DNSConstants.PROBE_WAIT_INTERVAL), DNSConstants.PROBE_WAIT_INTERVAL); } else if (!this.getDns().isCanceling() && !this.getDns().isCanceled()) { timer.schedule(this, DNSConstants.PROBE_CONFLICT_INTERVAL, DNSConstants.PROBE_CONFLICT_INTERVAL); } }
Set<DNSRecord> answers = new HashSet<DNSRecord>(); if (this.getDns().isAnnounced()) { try {
Set<DNSRecord> answers = new HashSet<DNSRecord>(); if (this.getDns().isAnnounced()) { try {
Set<DNSRecord> answers = new HashSet<DNSRecord>(); if (this.getDns().isAnnounced()) { try {
@Override public void run() { try { if (this.getDns().isCanceling() || this.getDns().isCanceled()) { this.cancel(); } else { if (_count++ < 3) { if (logger.isLoggable(Level.FINER)) { logger.finer(this.getName() + ".run() JmDNS " + this.description()); } DNSOutgoing out = new DNSOutgoing(DNSConstants.FLAGS_QR_QUERY); out = this.addQuestions(out); if (this.getDns().isAnnounced()) { out = this.addAnswers(out); } if (!out.isEmpty()) { this.getDns().send(out); } } else { // After three queries, we can quit. this.cancel(); } } } catch (Throwable e) { logger.log(Level.WARNING, this.getName() + ".run() exception ", e); this.getDns().recover(); } }
@Override public void run() { try { if (this.getDns().isCanceling() || this.getDns().isCanceled()) { this.cancel(); } else { if (_count++ < 3) { if (logger.isLoggable(Level.FINER)) { logger.finer(this.getName() + ".run() JmDNS " + this.description()); } DNSOutgoing out = new DNSOutgoing(DNSConstants.FLAGS_QR_QUERY); out = this.addQuestions(out); if (this.getDns().isAnnounced()) { out = this.addAnswers(out); } if (!out.isEmpty()) { this.getDns().send(out); } } else { // After three queries, we can quit. this.cancel(); } } } catch (Throwable e) { logger.log(Level.WARNING, this.getName() + ".run() exception ", e); this.getDns().recover(); } }
@Override public void run() { try { if (this.getDns().isCanceling() || this.getDns().isCanceled()) { this.cancel(); } else { if (_count++ < 3) { if (logger.isLoggable(Level.FINER)) { logger.finer(this.getName() + ".run() JmDNS " + this.description()); } DNSOutgoing out = new DNSOutgoing(DNSConstants.FLAGS_QR_QUERY); out = this.addQuestions(out); if (this.getDns().isAnnounced()) { out = this.addAnswers(out); } if (!out.isEmpty()) { this.getDns().send(out); } } else { // After three queries, we can quit. this.cancel(); } } } catch (Throwable e) { logger.log(Level.WARNING, this.getName() + ".run() exception ", e); this.getDns().recover(); } }
@Override public void run() { try { if (this.getDns().isCanceling() || this.getDns().isCanceled()) { this.cancel(); } else { if (_count++ < 3) { logger.debug("{}.run() JmDNS {}",this.getName(), this.description()); DNSOutgoing out = new DNSOutgoing(DNSConstants.FLAGS_QR_QUERY); out = this.addQuestions(out); if (this.getDns().isAnnounced()) { out = this.addAnswers(out); } if (!out.isEmpty()) { this.getDns().send(out); } } else { // After three queries, we can quit. this.cancel(); } } } catch (Throwable e) { logger.warn(this.getName() + ".run() exception ", e); this.getDns().recover(); } }