closed=true;
        public void run()        {            try            {                if (++count < 3)                {                    logger.finer("run() JmDNS canceling service");                    // announce the service                    //long now = System.currentTimeMillis();                    DNSOutgoing out = new DNSOutgoing(DNSConstants.FLAGS_QR_RESPONSE | DNSConstants.FLAGS_AA);                    for (int i = 0; i < infos.length; i++)                    {                        ServiceInfo info = infos[i];                        out.addAnswer(new DNSRecord.Pointer(info.type, DNSConstants.TYPE_PTR, DNSConstants.CLASS_IN, ttl, info.getQualifiedName()), 0);                        out.addAnswer(new DNSRecord.Service(info.getQualifiedName(), DNSConstants.TYPE_SRV, DNSConstants.CLASS_IN, ttl, info.priority, info.weight, info.port, localHost.getName()), 0);                        out.addAnswer(new DNSRecord.Text(info.getQualifiedName(), DNSConstants.TYPE_TXT, DNSConstants.CLASS_IN, ttl, info.text), 0);                        DNSRecord answer = localHost.getDNS4AddressRecord();                        if (answer != null)                        {                            out.addAnswer(answer, 0);                        }                        answer = localHost.getDNS6AddressRecord();                        if (answer != null)                        {                            out.addAnswer(answer, 0);                        }                    }                    send(out);                }                else                {                    // After three successful announcements, we are finished.                    synchronized (lock)                    {                        lock.notifyAll();                    }                    cancel();                }            }            catch (Throwable e)            {                logger.log(Level.WARNING, "run() exception ", e);                recover();            }        }