I have an application that uses channel API. The connections should be always alive (24x7) and I have implemented it in such a way that every time a channel gets disconnected, a new channel is created automatically. This works fine most of the times but I have scenarios where the onError() method does NOT gets called (E.g. Connected WIFI change, or Computer going to sleep and coming back). And my JS app falsely assumes that the channel is still alive when it is not.
One solution I thought of is to ping the server asking to send a message. Like a Keep Alive. But this is a big load for the server. (E.g. 1000 clients sending ping requests every 10 seconds is like 100 requests per second)
So I was wondering if there is a way to check if the connection is alive locally so that I wouldnt do a DoS attach on my server unintentionally.
Thanks