Check Internet connection

Hi, I have created a class to check internet connection with class Ping, but on device the application doesn’t works. I have a crash (see screenshots).
The Ping class is not compatible with iOS? I have used www, but is too heavy, it generates delayed rendering.

Thanks for help!

any idea? :frowning:

We’d need to see the code that’s failing.

attached!

Thanks!

2118201–139126–ANIMAL_ServerPing.cs (2.11 KB)

But is it possible use Ping on iOS?

Nobody help me? :frowning:

I expect your issue is that in your update() you have (pseudo code):

if(ping.isDone) {
  //
  // do ping stuff done
  //
} else {
  //
  // Ping failed
  //
}

This makes the assumption that the ping will be complete by the first call to Update() - this is very unlikely to be the case.

tldr; You assume the ping is failing before it’s had chance to complete.

See this thread: Am i using the ping class right? - Unity Engine - Unity Discussions

Sorry for my late…
doesn’t works again… always same errors :frowning: only on iOS… on Mac works fine…
:frowning:
any idea?!

What version of Unity are you using? There have been bugs with networking an IL2CPP that may have been fixed in later releases (if the patch release is newer than the main release try the latest patch release also).

I am using Unity5.0.2f1, there is a patch for this version?
Thanks!

hello, I’m having the exact same issue with Unity 5.1.1f1,
Can anybody please suggest any workaround.
thank you.

My workaround :frowning:
you can check every 5 seconds… because the test generate a lag…
on the script you can use ping or www… on iOS works only www :frowning:

2168353–143441–ANIMAL_ServerPing.cs (3.05 KB)