예제 #1
0
        static void Net_Test4_SpeedTest_Client()
        {
            string hostname = "speed.coe.ad.jp";

            CancellationTokenSource cts = new CancellationTokenSource();

            var client = new SpeedTestClient(LocalNet, LocalNet.GetIp(hostname), 9821, 1, 30000, SpeedTestModeFlag.Download, cts.Token);

            var task = client.RunClientAsync();

            //Con.ReadLine("Enter to stop>");

            ////int wait = 2000 + Util.RandSInt32_Caution() % 1000;
            ////Con.WriteLine("Waiting for " + wait);
            ////ThreadObj.Sleep(wait);

            //Con.WriteLine("Stopping...");
            //cts._TryCancelNoBlock();

            task._GetResult()._PrintAsJson();

            Con.WriteLine("Stopped.");
        }