You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.
Ie. looks like PersistentClient is supposed to catch any close events and reconnect.
However, the 'client' in this case is not actually a direct 'client' but the a sender class (PlatformSender), which does not actually emit 'close' events and therefore PersistentClient fails to reconnect as I assume it is designed to do.
As noted there, a fix is discussed here: thibauts/node-castv2-client#58 (comment), and indeed changing the line referenced above to use the 'inner client' works for me. Ie. change...
//If connection closes afterwards then re-open it againthat._client.once("close",function(){that._close();that._connectClient();});
...should be changed to...
//If connection closes afterwards then re-open it againthat._client.client.once("close",function(){that._close();that._connectClient();});
The text was updated successfully, but these errors were encountered:
It seems that sometimes a Chromecast device will disconnect from a client connected with this module.
There is a section of code in PersistentClient that looks like it is designed to cater for such events here:
https://github.com/angelnu/castv2-player/blob/523fd5a8317656a5038b7a7b3ca9d1de4e89f1a7/lib/persistentClient.js#L252
Ie. looks like PersistentClient is supposed to catch any close events and reconnect.
However, the 'client' in this case is not actually a direct 'client' but the a sender class (PlatformSender), which does not actually emit 'close' events and therefore PersistentClient fails to reconnect as I assume it is designed to do.
This manifests itself as issues such as iobroker-community-adapters/ioBroker.chromecast#36
As noted there, a fix is discussed here: thibauts/node-castv2-client#58 (comment), and indeed changing the line referenced above to use the 'inner client' works for me. Ie. change...
...should be changed to...
The text was updated successfully, but these errors were encountered: