| 1 |
/*******************************************************/ |
/*******************************************************/ |
| 2 |
/* */ |
/* */ |
| 3 |
/* LeafOK Innd */ |
/* LeafOK Innbbsd */ |
| 4 |
/* Copyright (C) LeafOK.com, 2003-2004 */ |
/* Copyright (C) LeafOK.com, 2003-2004 */ |
| 5 |
/* */ |
/* */ |
| 6 |
/* Programmed by Leaf */ |
/* Programmed by Leaf */ |
| 7 |
/* E-mail:leaf@leafok.com QQ:6049044 */ |
/* E-mail:leaflet@leafok.com QQ:6049044 */ |
| 8 |
/* */ |
/* */ |
| 9 |
/* http://bbs.leafok.com */ |
/* http://bbs.leafok.com */ |
| 10 |
/* http://bbs.leafok.net */ |
/* http://bbs.leafok.net */ |
| 14 |
|
|
| 15 |
#include "StdAfx.h" |
#include "StdAfx.h" |
| 16 |
#include ".\service.h" |
#include ".\service.h" |
| 17 |
|
#include ".\App_common.h" |
| 18 |
|
|
| 19 |
using namespace std; |
using namespace std; |
| 20 |
|
|
| 21 |
service::service(void) |
service::service(void) |
| 22 |
:CNTService("Innd Service") |
: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) |
service::~service(void) |
| 38 |
if (this->ctrld.begin() == 0) |
if (this->ctrld.begin() == 0) |
| 39 |
{ |
{ |
| 40 |
syslog << logfile::log_head << "Begin CONTROL ... OK" << endl; |
syslog << logfile::log_head << "Begin CONTROL ... OK" << endl; |
| 41 |
|
|
| 42 |
|
this->ctrld.StartupChild(); |
| 43 |
|
|
| 44 |
|
while (this->m_bIsRunning && this->ctrld.IsRunning()) |
| 45 |
|
{ |
| 46 |
|
Sleep(100); |
| 47 |
|
} |
| 48 |
|
|
| 49 |
|
this->ctrld.ShutdownChild(); |
| 50 |
} |
} |
| 51 |
else |
else |
| 52 |
{ |
{ |
| 53 |
syslog << logfile::log_head << "Begin CONTROL ... Failed" << endl; |
syslog << logfile::log_head << "Begin CONTROL ... Failed" << endl; |
| 54 |
} |
} |
| 55 |
|
|
|
this->ctrld.StartupChild(); |
|
|
|
|
|
while (this->m_bIsRunning && this->ctrld.IsRunning()) |
|
|
{ |
|
|
Sleep(100); |
|
|
} |
|
|
|
|
|
this->ctrld.ShutdownChild(); |
|
|
|
|
| 56 |
if (this->ctrld.end() == 0) |
if (this->ctrld.end() == 0) |
| 57 |
{ |
{ |
| 58 |
syslog << logfile::log_head << "End CONTROL ... OK" << endl; |
syslog << logfile::log_head << "End CONTROLD ... OK" << endl; |
| 59 |
} |
} |
| 60 |
else |
else |
| 61 |
{ |
{ |
| 62 |
syslog << logfile::log_head << "End CONTROL ... Failed" << endl; |
syslog << logfile::log_head << "End CONTROLD ... Failed" << endl; |
| 63 |
} |
} |
| 64 |
|
|
| 65 |
this->ctrld.CleanupThreadPool(); |
this->ctrld.CleanupThreadPool(); |