def testConnection(self, neighbor):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex((neighbor.ip,neighbor.port))
if result == 0:
return True
else:
return False
# test to see if we can still communicate to our neighbors
评论列表
文章目录