def _generate_host(self, ip):
host = None
# Use UDP. socket.SOCK_DGRAM
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(2.0)
try:
host_name, alias, ipaddr = socket.gethostbyaddr(str(ip))
host = Node.Node(ip, host_name)
except socket.herror as ex:
pass
return host
# Properties
评论列表
文章目录