예제 #1
0
        public void runThread()
        {
            try
            {
                string line = "";

                while ((line = reader.ReadLine()) != null)
                {
                    logwrite.write("runThread", line);

                    if (line.Length == 0)
                    {
                        continue;
                    }

                    MonitoringVO monVO = jsonHandler.recvJson(line);

                    if (monVO != null)
                    {
                        switch (monVO.getCmd())
                        {
                        case "M07":
                            logwrite.write("runThread", "M07 data -> " + monVO.getStrResult());
                            setSkillInfo(monVO.getStrResult());
                            break;

                        case "M08":
                            logwrite.write("runThread", "M08 data -> " + monVO.getStrResult());
                            break;

                        default:
                            break;
                        }
                    }


                    monObj.GetEventOnMon1(line);
                }
            }
            catch (Exception e)
            {
                logwrite.write("runThread", e.ToString());
                if (!monObj.disconnectReq)
                {
                    // 접속이 끊어지면 접속 재시도
                    monObj.monReConnect();
                }
            }
        }
예제 #2
0
 public void runThread()
 {
     try
     {
         while (true)
         {
             Thread.Sleep(1000);
             if (monObj.monReConnect() == ERRORCODE.SUCCESS)
             {
                 logwrite.write("MonSender renThread", "Connection Success !!");
                 break;
             }
             else
             {
                 logwrite.write("MonSender renThread", "Connection Fail !! Retry");
             }
         }
     }
     catch (Exception e)
     {
         logwrite.write("MonSender renThread", e.ToString());
     }
 }