This commit is contained in:
yumoqing 2021-06-17 15:55:15 +08:00
parent 2b0c6dec6a
commit 316d749cf5

View File

@ -7,6 +7,7 @@ BUFSIZE = 1024
class UdpComm: class UdpComm:
def __init__(self, port, callback, timeout=1): def __init__(self, port, callback, timeout=1):
self.callback = callback self.callback = callback
self.timeout = timeout
self.host = get_free_local_addr()[0] self.host = get_free_local_addr()[0]
self.port = port self.port = port
self.udpSerSock = socket(AF_INET, SOCK_DGRAM) self.udpSerSock = socket(AF_INET, SOCK_DGRAM)