''

def run(self):

    while True:
        event = None
        now = currentTimeMillis()
        if ((len(self.list) == 0) and (self.nextTime > now)):
            self.zc.wait((self.nextTime - now))
        if (_GLOBAL_DONE or self.done):
            return
        now = currentTimeMillis()
        if (self.nextTime <= now):
            out = DNSOutgoing(_FLAGS_QR_QUERY)
            out.addQuestion(DNSQuestion(self.type, _TYPE_PTR, _CLASS_IN))
            for record in self.services.values():
                if (not record.isExpired(now)):
                    out.addAnswerAtTime(record, now)
            self.zc.send(out)
            self.nextTime = (now + self.delay)
            self.delay = min((20 * 1000), (self.delay * 2))
        if (len(self.list) > 0):
            event = self.list.pop(0)
        if (event is not None):
            event(self.zc)
