AndroidAsync
AndroidAsync copied to clipboard
Callback is not received when network is poor and connection is terminated from other End
When we have used the library to connect to an backend and the signal strength is very poor and the backend has terminated the connection, we do not get call back this.socket.setClosedCallback(new CompletedCallback() { public void onCompleted(Exception var1) { } });
https://github.com/websockets/ws#how-to-detect-and-close-broken-connections you need to detect it by yourself, this is called ping pong / heartbeat method, where you send frequent packet e.g every 10 second and if the client does not reply in e.g 5 second you terminate the connection. I hope this help other ppl aswell.