I was trying to use the deluge integration of Home Assistant which uses this egg. I noticed that the deluge device in Home Assistant stayed unreachable after the deluge server was restarted. This happened because a broken connection was not detected and thus never reset.
Detect closed connections in _receive_response
When the connection to the deluge server was lost (the server was
restarted or shut down), _receive_response was stuck in a infinite
loop before. Since recv never returns any data the function never broke
out of the while loop. Raising a ConnectionLostException ensures the
retry logic can work as expected.
Hi! 👋
I was trying to use the
deluge
integration of Home Assistant which uses this egg. I noticed that the deluge device in Home Assistant stayed unreachable after the deluge server was restarted. This happened because a broken connection was not detected and thus never reset.Detect closed connections in
_receive_response
When the connection to the deluge server was lost (the server was restarted or shut down),
_receive_response
was stuck in a infinite loop before. Sincerecv
never returns any data the function never broke out of the while loop. Raising aConnectionLostException
ensures the retry logic can work as expected.Make the socket timeout configurable