From 879b32a007d5223cbf4323b26fc01ae43d3e71fe Mon Sep 17 00:00:00 2001 From: sangge <2251250136@qq.com> Date: Wed, 22 Nov 2023 16:37:05 +0800 Subject: [PATCH] fix: fix none message match --- src/client.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/client.py b/src/client.py index 433197d..1130d72 100644 --- a/src/client.py +++ b/src/client.py @@ -368,10 +368,12 @@ async def receive_request(i_m: IP_Message): # message = xxxxx # 根据message name到测试文本查找对应值 - message = test_msessgaes[i_m.message_name] + try: + message = test_msessgaes[i_m.message_name] - # message = b"hello world" + random.randbytes(8) - print(f"Generated message: {message}") + except: + message = b"hello world" + random.randbytes(8) + print(f"Message to be send: {message}") # send message to nodes await send_messages(tuple(node_ips), message, dest_ip, pk_B, threshold)