From 8d407119048f37515a4328fa7d739c6f0de6a669 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 18 Jun 2021 11:30:11 +0800 Subject: [PATCH] bugfix --- appPublic/udp_comm.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/appPublic/udp_comm.py b/appPublic/udp_comm.py index 0a3e180..36c4504 100644 --- a/appPublic/udp_comm.py +++ b/appPublic/udp_comm.py @@ -60,7 +60,10 @@ if __name__ == '__main__': def msg_handle(data, addr): print('addr:', addr, 'data=', data) - d = UdpComm(50000, msg_handle) + port = 50000 + if len(sys.argv)>1: + port = int(sys.argv[1]) + d = UdpComm(port, msg_handle) x = input() while x: d.broadcast(x)