This commit is contained in:
yumoqing 2021-06-18 11:30:11 +08:00
parent 316d749cf5
commit 8d40711904

View File

@ -60,7 +60,10 @@ if __name__ == '__main__':
def msg_handle(data, addr): def msg_handle(data, addr):
print('addr:', addr, 'data=', data) 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() x = input()
while x: while x:
d.broadcast(x) d.broadcast(x)