'Checks the network for a unique service name, modifying the
ServiceInfo passed in if it is not unique.'

def checkService(self, info):

    now = currentTimeMillis()
    nextTime = now
    i = 0
    while (i < 3):
        for record in self.cache.entriesWithName(info.type):
            if ((record.type == _TYPE_PTR) and (not record.isExpired(now)) and (record.alias == info.name)):
                if (info.name.find('.') < 0):
                    info.name = ((((((info.name + '.[') + info.address) + ':') + info.port) + '].') + info.type)
                    self.checkService(info)
                    return
                raise NonUniqueNameException
        if (now < nextTime):
            self.wait((nextTime - now))
            now = currentTimeMillis()
            continue
        out = DNSOutgoing((_FLAGS_QR_QUERY | _FLAGS_AA))
        self.debug = out
        out.addQuestion(DNSQuestion(info.type, _TYPE_PTR, _CLASS_IN))
        out.addAuthorativeAnswer(DNSPointer(info.type, _TYPE_PTR, _CLASS_IN, _DNS_TTL, info.name))
        self.send(out)
        i += 1
        nextTime += _CHECK_TIME
