/** * Send an outgoing multicast DNS message. * * @param out * @exception IOException */ public void send(DNSOutgoing out) throws IOException { if (!out.isEmpty()) { byte[] message = out.data(); final DatagramPacket packet = new DatagramPacket(message, message.length, _group, DNSConstants.MDNS_PORT); if (logger.isLoggable(Level.FINEST)) { try { final DNSIncoming msg = new DNSIncoming(packet); if (logger.isLoggable(Level.FINEST)) { logger.finest("send(" + this.getName() + ") JmDNS out:" + msg.print(true)); } } catch (final IOException e) { logger.throwing(getClass().toString(), "send(" + this.getName() + ") - JmDNS can not parse what it sends!!!", e); } } final MulticastSocket ms = _socket; if (ms != null && !ms.isClosed()) { ms.send(packet); } } }
/** * Send an outgoing multicast DNS message. * * @param out * @exception IOException */ public void send(DNSOutgoing out) throws IOException { if (!out.isEmpty()) { byte[] message = out.data(); final DatagramPacket packet = new DatagramPacket(message, message.length, _group, DNSConstants.MDNS_PORT); if (logger.isLoggable(Level.FINEST)) { try { final DNSIncoming msg = new DNSIncoming(packet); if (logger.isLoggable(Level.FINEST)) { logger.finest("send(" + this.getName() + ") JmDNS out:" + msg.print(true)); } } catch (final IOException e) { logger.throwing(getClass().toString(), "send(" + this.getName() + ") - JmDNS can not parse what it sends!!!", e); } } final MulticastSocket ms = _socket; if (ms != null && !ms.isClosed()) { ms.send(packet); } } }
/** * Send an outgoing multicast DNS message. * * @param out * @exception IOException */ public void send(DNSOutgoing out) throws IOException { if (!out.isEmpty()) { byte[] message = out.data(); final DatagramPacket packet = new DatagramPacket(message, message.length, _group, DNSConstants.MDNS_PORT); if (logger.isLoggable(Level.FINEST)) { try { final DNSIncoming msg = new DNSIncoming(packet); if (logger.isLoggable(Level.FINEST)) { logger.finest("send(" + this.getName() + ") JmDNS out:" + msg.print(true)); } } catch (final IOException e) { logger.throwing(getClass().toString(), "send(" + this.getName() + ") - JmDNS can not parse what it sends!!!", e); } } final MulticastSocket ms = _socket; if (ms != null && !ms.isClosed()) { ms.send(packet); } } }
if (!out.isEmpty()) { final InetAddress addr; final int port;
if (!out.isEmpty()) this.getDns().send(out);
if (!out.isEmpty()) this.getDns().send(out);
if (!out.isEmpty()) this.getDns().send(out);
if (!out.isEmpty()) this.getDns().send(out);
@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(); } }
if (!out.isEmpty()) { logger1.finer(this.getName() + ".run() JmDNS " + this.getTaskDescription() + " #" + this.getTaskState()); this.getDns().send(out);
if (!out.isEmpty()) { logger1.finer(this.getName() + ".run() JmDNS " + this.getTaskDescription() + " #" + this.getTaskState()); this.getDns().send(out);
if (!out.isEmpty()) { logger1.finer(this.getName() + ".run() JmDNS " + this.getTaskDescription() + " #" + this.getTaskState()); this.getDns().send(out);
if (!out.isEmpty()) { logger.debug("{}.run() JmDNS {} #{}", this.getName(), this.getTaskDescription(), this.getTaskState()); this.getDns().send(out);
@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(); } }