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
Hm, good catch. If the heartbeat fails, the reconnect timer is supposed to trigger and attempt to re-establish with the server. I'll take a look into this. Thanks for reporting it!
But this still wouldn't make possible for me to know the status of heartbeat push. So I have to use autoreconnect feature from the lib, because I cannot handle this myself.
About the heartbeat.
Right now we do have a problem that sometimes WS connection is killed without any kind of callback (onError or onClose). The only way to know that it was dropped is the heartbeat (or more precisely when it fails), that's why I thought it would good to know that.
Ofc this is not needed if we can rely on the lib logic to reconnect but sometimes we might want sth more custom.
In my case I always want to keep the connection open so I had to add some reconnection logic when onError is called as the lib was only handling reconnecting when the WS was closed(as it turned out it didn't :P). Right now to do what I need I will have to have reconnection logic: one handled by me and one by the lib. I would prefer to handle this in one place.
Activity
AdamGrzybkowski commentedon Feb 8, 2019
@dsrees hmm I think I know what could be the issue. If I'm not wrong the reconnectTimer is not initialized.
So basically if the heartbeat fails the connection is closed and nothing more happens.
Could you pls look at that?
dsrees commentedon Feb 8, 2019
Hm, good catch. If the heartbeat fails, the reconnect timer is supposed to trigger and attempt to re-establish with the server. I'll take a look into this. Thanks for reporting it!
AdamGrzybkowski commentedon Feb 8, 2019
I think this is whats missing AdamGrzybkowski@32c719f
But this still wouldn't make possible for me to know the status of heartbeat push. So I have to use
autoreconnectfeature from the lib, because I cannot handle this myself.dsrees commentedon Feb 9, 2019
That commit looks good, if you want to get a PR open
What are you trying to do specifically with the heartbeat?
AdamGrzybkowski commentedon Feb 10, 2019
PR created.
About the heartbeat.
Right now we do have a problem that sometimes WS connection is killed without any kind of callback (onError or onClose). The only way to know that it was dropped is the heartbeat (or more precisely when it fails), that's why I thought it would good to know that.
Ofc this is not needed if we can rely on the lib logic to reconnect but sometimes we might want sth more custom.
In my case I always want to keep the connection open so I had to add some reconnection logic when
onErroris called as the lib was only handling reconnecting when the WS was closed(as it turned out it didn't :P). Right now to do what I need I will have to have reconnection logic: one handled by me and one by the lib. I would prefer to handle this in one place.dsrees commentedon Feb 10, 2019
Available in 0.1.5