} catch (IOException e) { e.printStackTrace();
} catch (IOException e) { logger.log(Level.WARNING, "run() exception " , e);
        public void run() {            try {                byte buf[] = new byte[DNSConstants.MAX_MSG_ABSOLUTE];                DatagramPacket packet = new DatagramPacket(buf, buf.length);                while (state != DNSState.CANCELED) {                    packet.setLength(buf.length);                    socket.receive(packet);                    if (state == DNSState.CANCELED) {                        break;                    }                    try {                        InetAddress from = packet.getAddress();                        if (linklocal != isLinkLocal(from)) {                            // Ignore linklocal packets on regular interfaces, unless this is                            // also a linklocal interface. This is to avoid duplicates. This is                            // a terrible hack caused by the lack of an API to get the address                            // of the interface on which the packet was received.                            continue;                        }                        if (loopback != isLoopback(from)) {                            // Ignore loopback packets on a regular interface unless this is                            // also a loopback interface.                            continue;                        }                        DNSIncoming msg = new DNSIncoming(packet);                        if (debug > 2) {                            System.out.print("JmDNS in:");                            msg.print(debug > 3);                            System.out.println();                        }                                                synchronized (ioLock) {                            if (msg.isQuery()) {                                if (packet.getPort() != DNSConstants.MDNS_PORT) {                                    handleQuery(msg, packet.getAddress(), packet.getPort());                                }                                handleQuery(msg, group, DNSConstants.MDNS_PORT);                            }                            else {                                handleResponse(msg);                            }                        }                    }                    catch (IOException e) {                        e.printStackTrace();                    }                }            } catch (IOException e) {                if (state != DNSState.CANCELED) {                    e.printStackTrace();                    close();                }            }        }