2014年1月12日 星期日

20120816 利用 thread 來做 timeout 功能

DateTime startTime = DateTime.Now;
   m_Samba_flag = false;
   Thread StartSamba_thread = new Thread(new ThreadStart(StartSamba_process));
   StartSamba_thread.Start();
   while (!m_Samba_flag && (DateTime.Now < startTime)) ;
   StartSamba_thread.Abort();


   if (DateTime.Now > startTime) return false;

public void StartSamba_process()
{
            string cmd = "SambaTest.bat";
            cmd =GlobalStatic.RunCmd_Hide(cmd);
            MainForm.Instance.ShowTest_Info(1, cmd, Color.Gray);
            m_Samba_flag = true;
}

沒有留言:

Iperf3.1.3 使用方法

20190417: 使用 Iperf3.1.3 • Server : Iperf 3 - s - w 1024k • Client: Iperf 3 - c 192.168.1.10 -R -w 1024k  -i 1 -t 10  -P 6 //-c: TCP client /...