Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

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