Closed masad-frost closed 5 years ago
Hi,
Thanks for reporting. You can do that using latest version of the lib:
rws.addEventListener('close', e => {
if (e.code === SOME_CODE) { // you could also check the reason
rws.close(); // this keep closed and stop trying to reconnect
}
});
Please, reopen this issue if that doesn't work for you
In the initial release of v4 close events coming from server did not trigger a reconnect. Which meant I was able to reconnect conditionally. My use case is that if a disconnect happens for a specific
reason
I don't want the client to retry. I can handle reconnection myself by callingreconnect
.