Closed JumaLuata closed 1 year ago
I'm not sure this is safe in all contexts. Ideally, the ECU should actually fail at the doip layer if you try too soon but I expect there's going to be some that choke if you attempt to establish a socket too fast. TCP sockets are expensive and memory tends to be limited so during cleanup I wouldn't be surprised if some vendors don't handle this gracefully.
Perhaps a keyword argument to enable polling that is off by default.
Also you should be catching subsets of Exception at worst not just bare except. Ideally, specific socket exceptions but there's probably a bunch
Hello I often need to use the
reconnect
interface in my projects, but the time required for reconnection is uncertain. At present, the interface directly usestime.sleep()
. My optimization is to try to connect every second within theclose_delay
time. If the connection is successful, directlyreturn
. So I just need to set a larger time as RECONNECT TIMEOUT