This commit is contained in:
yumoqing 2021-07-14 14:33:00 +08:00
parent 2315f8706a
commit 35bfe95bfb

View File

@ -24,11 +24,8 @@ class UdpComm:
while self.run_flg: while self.run_flg:
try: try:
b, addr = self.udpSerSock.recvfrom(BUFSIZE) b, addr = self.udpSerSock.recvfrom(BUFSIZE)
data = json.loads(b)
if addr[0] != self.host: if addr[0] != self.host:
self.callback(data, addr) self.callback(b, addr)
# ret = json.dumps(self.info).encode('utf-8')
# self.udpSerSock.sendto(ret, addr)
except Exception as e: except Exception as e:
print('exception happened:',e) print('exception happened:',e)
pass pass