Example #1
0
 def make_unique_stream_id(self):
     global _StreamCounter
     _StreamCounter += 1
     n = 10 + max(contactsdb.contact_position(self.session.peer_idurl),
                  0) % 89
     return n * 1000000 + random.randint(
         10, 99) * 10000 + _StreamCounter % 10000
Example #2
0
 def make_unique_stream_id(self):
     # return int(str(random.randint(100, 999))+str(int(time.time() *
     # 100.0))[7:])
     global _StreamCounter
     _StreamCounter += 1
     # if _StreamCounter >= 10000:
     #     _StreamCounter = 1
     n = max(contactsdb.contact_position(self.session.peer_idurl), 0) % 89
     return (n + 10) * 1000000 + random.randint(10, 99) * \
         10000 + _StreamCounter % 10000
Example #3
0
 def make_unique_stream_id(self):
     # return int(str(random.randint(100, 999))+str(int(time.time() *
     # 100.0))[7:])
     global _StreamCounter
     _StreamCounter += 1
     # if _StreamCounter >= 10000:
     #     _StreamCounter = 1
     n = max(contactsdb.contact_position(self.session.peer_idurl), 0) % 89
     return (n + 10) * 1000000 + random.randint(10, 99) * \
         10000 + _StreamCounter % 10000