(self, server)
refactor me
refactor me
refactor me
def sendUDPRequest(self, server):
        "refactor me"
        self.response = None
        self.socketInit(socket.AF_INET, socket.SOCK_DGRAM)
        for self.ns in server:
            try:
                # TODO. Handle timeouts &c correctly (RFC)
                #self.s.connect((self.ns, self.port))
                self.conn()
                self.time_start = time.time()
                if not self.async:
                    self.s.send(self.request)
                    self.response = self.processUDPReply()
            # except socket.error:
            except None:
                continue
            break
        if not self.response:
            if not self.async:
                raise DNSError('no working nameservers found')
def sendUDPRequest ( self , server ) : self . response = None self . socketInit ( socket . AF_INET , socket . SOCK_DGRAM ) for self . ns in server : try : # TODO. Handle timeouts &c correctly (RFC) #self.s.connect((self.ns, self.port)) self . conn ( ) self . time_start = time . time ( ) if not self . async : self . s . send ( self . request ) self . response = self . processUDPReply ( ) # except socket.error: except None : continue break if not self . response : if not self . async : raise DNSError ( 'no working nameservers found' )