Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Callback is not received when network is poor and connection is terminated from other End #709

Open
ManuKow opened this issue Apr 25, 2022 · 1 comment

Comments

@ManuKow
Copy link

ManuKow commented Apr 25, 2022

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) {
}
});

@NRicode
Copy link

NRicode commented Oct 17, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants