Pings and using isDone still works on airplane mode?

I am using pings in my game to determine if the user has an internet connection. However, they’re not working as expected. When I install my game on my phone and put my phone on airplane mode, the pings are still completing. Any ideas why this is happening? Am I using pings incorrectly? Here’s a shortened version of the logic I’m using.

public IEnumerator StartPing(string ip)
    {

        Ping p = new Ping(ip);
        float startTime = Time.time;

        while (!p.isDone && Time.time < startTime + 5.0f)
        {
            yield return new WaitForSeconds(0.1f);
        }
        if (p.isDone) //if the ping completed
        {
                Debug.Log("PING: successful");      
        }
        else
        {
            Debug.Log("Ping: failed. IP:" + ip);
        }
    }

It seems there’s no option to get another ping result except time. So i suppose this done flag is set to true after host replies or times out. Check p.time value to determine that. May be there’s somethin like -1 or NaN?

p.time gave me -1! If I try it with airplane mode off, I get 18 (not sure what unit p.time is in, calculating response time using Time.time - startTime gives me 0.1005859).

Interesting how using p.time is the only reliable way to check if a ping actually went through. Thank you, I never would have thought of that!

I believe this 18 is in milliseconds.

That makes sense, thanks again!