def _getToken(self,destIp,destPort):
        with self.transmittersLock:
            self._cleanupTransmitter()
            found = False
            while not found:
                token = random.randint(0x00,0xff)
                alreadyUsed = False
                for (kIp,kPort,kToken,kMessageId) in self.transmitters.keys():
                    if destIp==kIp and destPort==kPort and token==kToken:
                        alreadyUsed = True
                        break
                if not alreadyUsed:
                    found = True
            return token
\pre transmittersLock is already acquired.
dataset/ETHPy150Open openwsn-berkeley/coap/coap/coap.py/coap._getToken