Search Unity

Ping always faild on iOS 14.7.1

Discussion in 'iOS and tvOS' started by orangetech, Sep 8, 2021.

  1. orangetech

    orangetech

    Joined:
    Sep 30, 2017
    Posts:
    48
    Ping localnetwork always faild on iOS 14.7.1. whatever Local permission is on or off.
    here is my code. reporduce this problem, please type local network ip like 192.168.1.1, give permission allow.you will see timeout.
    ping local network always timeout, ping internet always success.
    strange.
    Code (CSharp):
    1.     public InputField inputField;
    2.    
    3.     public void OnStratPingButton() {
    4.         Stopwatch s = new Stopwatch();
    5.         s.Start();
    6.         var p = new Ping(inputField.text);
    7.         Debug.Log("startping:"+ inputField.text);
    8.         while (!p.isDone && s.ElapsedMilliseconds < 3000) {
    9.             Thread.Sleep(100);
    10.         }
    11.         Debug.Log("timeout:"+(s.ElapsedMilliseconds) +"|"+p.time);
    12.         s.Stop();
    13.     }
     
  2. orangetech

    orangetech

    Joined:
    Sep 30, 2017
    Posts:
    48
    Can anyone reporduce it?
     
  3. orangetech

    orangetech

    Joined:
    Sep 30, 2017
    Posts:
    48
unityunity