void MonitorSelectTimer_Function(object sender, EventArgs e) { Monitoring_Select_Timer_.Enabled = false; if (CheckerINIManager.Instance.MonitorSeq_ > 0) { Int32 Result = 0; Int32 ChannelSeq = 0; Int32 AuthoritySeq = 0; Int32 Mode = 0; Int32 CrawlerSeq = 0; CheckerDBInterface.UpdateCrawlerMonitorInfo(CheckerAppManager.Instance.DB(), CheckerINIManager.Instance.MonitorSeq_ , UTIL.CLIENTIP, CheckerINIManager.Instance.ListenCrawlerPort_, "OK", ref Result, ref ChannelSeq, ref AuthoritySeq , ref Mode, ref CrawlerSeq); if (Result > 0 && ChannelSeq > 0 && AuthoritySeq > 0 && Mode > 0 && CrawlerSeq > 0) { SetInfo(); StartChecker(AuthoritySeq, ChannelSeq, CrawlerSeq, Mode); return; } else { SetInfo(); CheckerAppManager.Instance.CHECKER_STATE_ = CHECKER_STATE.WAIT_MONITOR_TABLE_SET; } } LastSelectCheckTime_ = Environment.TickCount; Monitoring_Select_Timer_.Enabled = true; }
void ConnectDBAndGetCrawlerInfo() { bool bResult = ConnectDB(); if (bResult == true) { if (CheckerINIManager.Instance.MonitorSeq_ > 0) { Int32 Result = 0; Int32 ChannelSeq = 0; Int32 AuthoritySeq = 0; Int32 Mode = 0; Int32 CrawlerSeq = 0; CheckerDBInterface.UpdateCrawlerMonitorInfo(CheckerAppManager.Instance.DB(), CheckerINIManager.Instance.MonitorSeq_ , UTIL.CLIENTIP, CheckerINIManager.Instance.ListenCrawlerPort_, "OK", ref Result, ref ChannelSeq, ref AuthoritySeq , ref Mode, ref CrawlerSeq); if (Result > 0 && ChannelSeq > 0 && AuthoritySeq > 0 && Mode > 0 && CrawlerSeq > 0) { StartChecker(AuthoritySeq, ChannelSeq, CrawlerSeq, Mode); } else { SetInfo(); CheckerAppManager.Instance.CHECKER_STATE_ = CHECKER_STATE.WAIT_MONITOR_TABLE_SET; InitMonitorCheckTimer();// 이제 매니저에서 제대로 등록되기만을 기다리면 된다. } } else { Int32 MonitorSeq = 0; CheckerDBInterface.InsertCrawlerMonitorInfo(CheckerAppManager.Instance.DB(), UTIL.CLIENTIP , CheckerINIManager.Instance.ListenCrawlerPort_, ref MonitorSeq); if (MonitorSeq > 0) { CheckerINIManager.Instance.UpdateMonitorSeq(CheckerINIPath_, MonitorSeq); CheckerAppManager.Instance.CHECKER_STATE_ = CHECKER_STATE.WAIT_MONITOR_TABLE_SET; InitMonitorCheckTimer();// 이제 매니저에서 제대로 등록되기만을 기다리면 된다. } else { // 에러남 표시하고 아무것도 하지말자 CheckerAppManager.Instance.CHECKER_STATE_ = CHECKER_STATE.ERROR; CheckerAppManager.Instance.ErrorString_ = "DB에 모니터링 Insert 중에 문제가 발생함"; } } } }
void StateUpdateTimer_Function(object sender, EventArgs e) { State_Update_Timer_.Enabled = false; Int32 Result = 0; Int32 ChannelSeq = 0; Int32 AuthoritySeq = 0; Int32 Mode = 0; Int32 CrawlerSeq = 0; CheckerDBInterface.UpdateCrawlerMonitorInfo(CheckerAppManager.Instance.DB() , CheckerINIManager.Instance.MonitorSeq_, UTIL.CLIENTIP, CheckerINIManager.Instance.ListenCrawlerPort_ , "OK", ref Result, ref ChannelSeq, ref AuthoritySeq, ref Mode, ref CrawlerSeq); LastCheckUpdateTime_ = Environment.TickCount; State_Update_Timer_.Enabled = true; }