Search Unity

Ping always faild on iOS 14.7.1

Discussion in 'Multiplayer' started by orangetech, Sep 9, 2021.

  1. orangetech

    orangetech

    Joined:
    Sep 30, 2017
    Posts:
    50
    Ping localnetwork always faild on iOS 14.7.1.
    ping local network always timeout, ping internet always success.Even local network permission is on or off.
    so strange.
    To reporduce this problem, please type local network ip like 192.168.1.1, than iOS will pop a permission window, allow it. than test ping a local a local ip. 90% chance I get timeout.

    here is my test code, only happened on iOS build:
    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.     }
    What happen on you guys device? iOS bug? anyone help me please
     
  2. orangetech

    orangetech

    Joined:
    Sep 30, 2017
    Posts:
    50
    Found the reason is iOS buider for windows's bug
     
  3. orangetech

    orangetech

    Joined:
    Sep 30, 2017
    Posts:
    50