Open indapublic opened 5 years ago
I'm using "reconnecting-websocket": "^4.1.10" in React Native project.
"reconnecting-websocket": "^4.1.10"
My code for websocket initializing:
this.ws = new ReconnectingWebSocket(this.url) this.ws.onopen = connectedHandler this.ws.onclose = disconnectedHandler this.ws.onerror = disconnectedHandler this.ws.addEventListener('error', (e) => { disconnectedHandler() }) this.ws.addEventListener('close', (e) => { disconnectedHandler() }) this.ws.addEventListener('open', (e) => { connectedHandler() })
So I will call disconnectedHandler for close and error events.
disconnectedHandler
close
error
But those events not fired when I lost my connection
I'm using
"reconnecting-websocket": "^4.1.10"
in React Native project.My code for websocket initializing:
So I will call
disconnectedHandler
forclose
anderror
events.But those events not fired when I lost my connection