def get_nat_type(self, callback=None): self.sesslock.acquire() try: return ConnectionCheck.getInstance(self).get_nat_type( callback=callback) finally: self.sesslock.release()
def gotDoNatCheckMessage(self, sender_permid, selversion, channel_id, payload, reply_callback): self.doNatCheckSender = sender_permid self.crawler_reply_callbacks.append(reply_callback) try: if DEBUG: print >> sys.stderr, 'NatCheckMsgHandler: start_nat_type_detect()' conn_check = ConnectionCheck.getInstance(self.session) conn_check.try_start(self.natthreadcb_natCheckReplyCallback) except: print_exc() return False return True
def get_nat_type(self, callback = None): self.sesslock.acquire() try: return ConnectionCheck.getInstance(self).get_nat_type(callback=callback) finally: self.sesslock.release()