Ejemplo n.º 1
0
 def get_nat_type(self, callback=None):
     self.sesslock.acquire()
     try:
         return ConnectionCheck.getInstance(self).get_nat_type(
             callback=callback)
     finally:
         self.sesslock.release()
Ejemplo n.º 2
0
    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
Ejemplo n.º 3
0
    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
Ejemplo n.º 4
0
 def get_nat_type(self, callback = None):
     self.sesslock.acquire()
     try:
         return ConnectionCheck.getInstance(self).get_nat_type(callback=callback)
     finally:
         self.sesslock.release()