Answer the question
In order to leave comments, you need to log in
How to remove websocket handlers or set up reconnection when a connection appears?
I am writing an application in React Native that uses Websocket.
When the Internet is disconnected and restored - they do not reconnect.
I tried to re-create the Websocket object when the Internet appeared, and remove the handlers from the old one and call close ().
But this does not help, because two listeners are working out.
How can I reconnect? Or maybe there is some library?
Answer the question
In order to leave comments, you need to log in
at 403 start connection attempts via setInterval until the connection is restored
ps most likely the session will end anyway until the connection appears.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question