10.09.2019, 14:48
I'll check this more thoroughly but there are some issues with your script:
1. Do not use socket.connect() because it is blocking, use copas.connect()
2. There's no need to pass any length to UDP receive. Without any length it will return one datagram (or error on timeout) per call
3. Your reconnect procedure seems wrong, you don't have to call removethread and sockets do not have state field
4. sendtcp does not check if socket is connected/available
1. Do not use socket.connect() because it is blocking, use copas.connect()
2. There's no need to pass any length to UDP receive. Without any length it will return one datagram (or error on timeout) per call
3. Your reconnect procedure seems wrong, you don't have to call removethread and sockets do not have state field
4. sendtcp does not check if socket is connected/available