Esempio n. 1
0
 public static void Awake(this BenchmarkComponent self, IPEndPoint ipEndPoint)
 {
     try
     {
         NetOuterComponent networkComponent = Game.Scene.GetComponent <NetOuterComponent>();
         for (int i = 0; i < 1000; i++)
         {
             self.TestAsync(networkComponent, ipEndPoint, i);
         }
     }
     catch (Exception e)
     {
         Log.Error(e);
     }
 }
Esempio n. 2
0
 public static void Awake(this BenchmarkComponent self, string address)
 {
     try
     {
         IPEndPoint        ipEndPoint       = NetworkHelper.ToIPEndPoint(address);
         NetOuterComponent networkComponent = Game.Scene.GetComponent <NetOuterComponent>();
         for (int i = 0; i < 1000; i++)
         {
             self.TestAsync(networkComponent, ipEndPoint, i).Coroutine();
         }
     }
     catch (Exception e)
     {
         Log.Error(e);
     }
 }
Esempio n. 3
0
        private static async void Awake(this BenchmarkComponent component, string address)
        {
            try
            {
                NetOuterComponent networkComponent = Game.Scene.GetComponent <NetOuterComponent>();

                for (int i = 0; i < 100; i++)
                {
                    await Game.Scene.GetComponent <TimerComponent>().WaitAsync(10);

                    component.TestAsync(networkComponent, address, i);
                }
            }
            catch (Exception e)
            {
                Log.Error(e.ToString());
            }
        }