Jc2k / aiohomekit

asyncio for homekit
Apache License 2.0
52 stars 20 forks source link

Fix IP controller not reconnecting right away #376

Closed bdraco closed 3 months ago

bdraco commented 3 months ago

There were two problems that prevented the IP transport from reconnecting

  1. When the connection was lost, _start_connector would not try to reconnect because self.transport and self.protocol were still set which meant the connection was not fully torn down and it thought it was still connected. This is fixed by clearing transport and protocol before calling _start_connector. This meant we would never reconnect until a poll attempt which restarted the connector.

  2. If a request was inflight the connection would get re-established and than the concurrency lock would prevent the pair-verify from happening. This is fixed by resolving all the futures that are waiting when the connection is lost.

bdraco commented 3 months ago

Thanks. I'll get a release done shortly