'Generates a unique transaction id and stores this in the _active_session_dict set.'

def generate_transaction_id(self):

    while True:
        transaction_id = random.randint(0, MAX_INT32)
        if (transaction_id not in UdpTrackerSession._active_session_dict.items()):
            UdpTrackerSession._active_session_dict[self] = transaction_id
            self._transaction_id = transaction_id
            break
