Ejemplo n.º 1
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 < 2000; i++)
				{
					self.TestAsync(networkComponent, ipEndPoint, i);
				}
			}
			catch (Exception e)
			{
				Log.Error(e);
			}
		}
Ejemplo n.º 2
0
		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);
			}
		}