mzanetti / kodimote

Kodimote is a remote control application for Kodi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[conn] improve reconnecting

RobertMe opened this issue · comments

Currently the app only tries to reconnect after an error on the TCP socket. But this means it doesn't reconnect when Kodi disconnects. So the reconnection also needs to happen when Kodi closes the connection. This is mostly needed for #3, as the servers are bound to the profile, and Kodi thus restarts the servers when switching profiles.

Furthermore the timer which does the reconnection is always running. This is however only needed when the app is visible (and/or active, for most OSes this is the same, but on Sailfish OS you'd probably still want to reconnect when the active cover is visible).

Another small improvement is to keep the "connecting" flag set as long as the reconnection timer is running. Otherwise its state just keeps changing.

Implemented and merged