public static void Awake(this WebSocketBenchmarkComponent self, string address) { try { NetOuterComponent networkComponent = Game.Scene.GetComponent <NetOuterComponent>(); for (int i = 0; i < 1000; i++) { self.TestAsync(networkComponent, i, address).Coroutine(); } } catch (Exception e) { Log.Error(e); } }
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 < 2000; i++) { self.TestAsync(networkComponent, ipEndPoint, i); } } catch (Exception e) { Log.Error(e); } }
public static async void TestAsync(this BenchmarkComponent self, NetOuterComponent networkComponent, IPEndPoint ipEndPoint, int j) { try { using (Session session = networkComponent.Create(ipEndPoint)) { int i = 0; while (i < 100000000) { ++i; await self.Send(session, j); } } } catch (Exception e) { Log.Error(e); } }
public static async ETVoid TestAsync(this WebSocketBenchmarkComponent self, NetOuterComponent networkComponent, int j, string address) { try { using (Session session = networkComponent.Create(address)) { int i = 0; while (i < 100000000) { ++i; await self.Send(session, j); } } } catch (RpcException e) { Log.Error(e); } catch (Exception e) { Log.Error(e); } }