From 14a6ac78fc767f9c0cc1ecfe6a73ee875839f666 Mon Sep 17 00:00:00 2001 From: Aryan Singh Date: Sat, 12 Sep 2026 20:48:10 -0500 Subject: [PATCH] Update client.py --- MP1/client.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/MP1/client.py b/MP1/client.py index 0576f7a..8195f4a 100644 --- a/MP1/client.py +++ b/MP1/client.py @@ -62,7 +62,7 @@ def grep_all_ips(ips, cmd): except Exception as e: print(f"Failed to connect to {ip}:{PORT} - {e}") - match_count.append(0) + match_count.append(-1) finally: client_socket.close() @@ -74,6 +74,9 @@ while True: print("=========================== SUMMARY ===========================") for i, count in enumerate(match_count): + if count == -1: + print(f"machine.{i + 1}.log: Connection failed") + else: print(f"machine.{i + 1}.log: {count} matches") print(f"Total matches: {sum(match_count)}") print("===============================================================") \ No newline at end of file