public int CfLoad()
        {
            CtkThreadingUtil.RunWorkerAsyn(delegate(object sender, DoWorkEventArgs e)
            {
                for (int idx = 0; !this.disposed; idx++)
                {
                    try
                    {
                        hsmsConnector.ConnectIfNo();
                    }
                    catch (Exception ex)
                    {
                        CtkLog.Write(ex);
                        System.Threading.Thread.Sleep(5000);//無法連線等待5秒
                    }


                    try
                    {
                        hsmsConnector.ReceiveRepeat();
                    }
                    catch (Exception ex)
                    {
                        CtkLog.Write(ex);
                        System.Threading.Thread.Sleep(5000);//無法連線等待5秒
                    }
                    finally { System.Threading.Thread.Sleep(1000); }
                }
            });
            return(0);
        }
Exemple #2
0
 public int CfRunOnce()
 {
     try
     {
         hsmsConnector.ConnectIfNo();
         hsmsConnector.ReceiveRepeat();
     }
     catch (Exception ex)
     {
         CtkLog.Write(ex);
     }
     finally { System.Threading.Thread.Sleep(1000); }
     return(0);
 }