(self, ip)
return host
rdns with a timeout
rdns with a timeout
rdns with a timeout
def resolve(self, ip):
        """rdns with a timeout"""
        socket.setdefaulttimeout(2)
        try:
            host = socket.gethostbyaddr(ip)
        except:
            host = None
        if not host is None:
            host = host[0]
        return host
def resolve ( self , ip ) : socket . setdefaulttimeout ( 2 ) try : host = socket . gethostbyaddr ( ip ) except : host = None if not host is None : host = host [ 0 ] return host