# client.py import socket PORT = 5000 ALL_IPS = [ "172.22.156.3", "172.22.158.2", "172.22.94.2", "172.22.156.4", "172.22.158.3", "172.22.94.3", "172.22.156.5", "172.22.158.4", "172.22.94.4", "172.22.156.6" ] def grep_all_ips(ips): for ip in ips: try: client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) client_socket.connect((ip, PORT)) print(f"Connected to server at {ip}:{PORT}") client_socket.sendall(b"Hello from client!") data = client_socket.recv(1024) print("Received:", data.decode()) except Exception as e: print(f"Failed to connect to {ip}:{PORT} - {e}") finally: client_socket.close() grep_all_ips(ALL_IPS)