Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Guzz-T opened this issue Feb 14, 2024 · 2 comments
Open

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

Guzz-T opened this issue Feb 14, 2024 · 2 comments

Comments

@Guzz-T
Copy link
Contributor

Guzz-T commented Feb 14, 2024

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 Guzz-T changed the title socket.recv waits infinite when the connection is lost socket.recv() waits infinite when the connection is lost Feb 14, 2024
@gerw
Copy link
Collaborator

gerw commented Feb 15, 2024

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?

@Guzz-T
Copy link
Contributor Author

Guzz-T commented Feb 15, 2024

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".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants