/[LeafOK_CVS]/innwebd/service.cpp
ViewVC logotype

Contents of /innwebd/service.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations)
Tue Aug 10 19:55:57 2004 UTC (21 years, 7 months ago) by sysadm
Branch: MAIN
Changes since 1.4: +15 -12 lines
Content type: text/x-c++src
Startup CONTROLD until ok or program terminated.

1 /*******************************************************/
2 /* */
3 /* LeafOK Innbbsd */
4 /* Copyright (C) LeafOK.com, 2003-2004 */
5 /* */
6 /* Programmed by Leaf */
7 /* E-mail:leaflet@leafok.com QQ:6049044 */
8 /* */
9 /* http://bbs.leafok.com */
10 /* http://bbs.leafok.net */
11 /* http://bbs.fenglin.info */
12 /* */
13 /*******************************************************/
14
15 #include "StdAfx.h"
16 #include ".\service.h"
17 #include ".\App_common.h"
18
19 using namespace std;
20
21 service::service(void)
22 :CNTService(App_common::ServiceName)
23 {
24 this->m_iMajorVersion = App_common::Ver_Major;
25 this->m_iMinorVersion = App_common::Ver_Minor;
26 }
27
28 service::~service(void)
29 {
30 }
31
32 void service::Run()
33 {
34 this->ctrld.StartupDelay();
35
36 this->ctrld.InitThreadPool();
37
38 while (this->m_bIsRunning)
39 {
40 if (this->ctrld.begin() ==0)
41 {
42 syslog << logfile::log_head << "Begin CONTROLD ... OK" << endl;
43
44 this->ctrld.StartupChild();
45
46 break;
47 }
48 syslog << logfile::log_head << "Begin CONTROLD ... Failed" << endl;
49 Sleep(1000 * 60);
50 }
51
52 while (this->m_bIsRunning && this->ctrld.IsRunning())
53 {
54 Sleep(100);
55 }
56
57 this->ctrld.ShutdownChild();
58
59 if (this->ctrld.end() == 0)
60 {
61 syslog << logfile::log_head << "End CONTROLD ... OK" << endl;
62 }
63 else
64 {
65 syslog << logfile::log_head << "End CONTROLD ... Failed" << endl;
66 }
67
68 this->ctrld.CleanupThreadPool();
69 }

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1