python-luxtronik icon indicating copy to clipboard operation
python-luxtronik copied to clipboard

socket.recv() waits infinite when the connection is lost

Open Guzz-T opened this issue 1 year ago • 2 comments

If the connection is already established, a new call to read() will never finished in case the connection to the heat pump is lost inbetween.

It seems to resume if the heat pump is available again.

Is this a bug or a feature?

Guzz-T avatar Feb 14 '24 22:02 Guzz-T

We could set _socket.setdefaulttimeout() to a sensible value, e.g., 5 seconds.

What shall we do when the timeout occurs? Raise an error? Try to reconnect?

gerw avatar Feb 15 '24 06:02 gerw

Normally I would close the socket and return the error status using the return parameter. The user then has to handle the error.

But that's almost like an "API change".

Guzz-T avatar Feb 15 '24 21:02 Guzz-T