Just that, is there a way to detect if the internet connection is available on a mobile device?. Can I do some kind of ping to server using websockets? Will websockets help me with that?
I'm kinda desperate, because I thought websockets had a ping function on the client-side box, but not I try to find something about that, and there's nothing like that, besides websockets seem only to respond to connections and data transmission events.
You can try to ping a server, as you already considered. This question contains a working example which uses the native Image object to do this.
I hope this helps.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.