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

Diff of /innwebd/innbbsd.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.3 by sysadm, Sat Jul 3 15:10:23 2004 UTC Revision 1.7 by sysadm, Fri Apr 11 17:14:49 2008 UTC
# Line 1  Line 1 
1  /*******************************************************/  /*******************************************************/
2  /*                                                     */  /*                                                     */
3  /*  LeafOK Innd                                        */  /*  LeafOK Innbbsd                                     */
 /*  Copyright (C) LeafOK.com, 2003-2004                */  
4  /*                                                     */  /*                                                     */
5  /*  Programmed by Leaf                                 */  /*  Copyright (C) LeafOK.com, 2003-2008                */
 /*  E-mail:leaf@leafok.com  QQ:6049044                 */  
6  /*                                                     */  /*                                                     */
7  /*  http://bbs.leafok.com                              */  /*  http://www.leafok.com                              */
 /*  http://bbs.leafok.net                              */  
 /*  http://bbs.fenglin.info                            */  
8  /*                                                     */  /*                                                     */
9  /*******************************************************/  /*******************************************************/
10    
# Line 20  Line 16 
16  #include ".\innbbsd.h"  #include ".\innbbsd.h"
17  #include ".\service.h"  #include ".\service.h"
18  #include ".\bbs_fun.h"  #include ".\bbs_fun.h"
19    #include ".\App_common.h"
20    
21  #ifdef _DEBUG  #ifdef _DEBUG
22  #define new DEBUG_NEW  #define new DEBUG_NEW
# Line 62  int _tmain(int argc, TCHAR* argv[], TCHA Line 59  int _tmain(int argc, TCHAR* argv[], TCHA
59    
60          syslog.open(app_path + log_file, ios_base::out | ios_base::app);          syslog.open(app_path + log_file, ios_base::out | ios_base::app);
61    
62            // Report program information
63            syslog << "********************" << endl;
64            syslog << App_common::GetVersion() << endl;
65            syslog << App_common::Copyright << endl;
66            syslog << logfile::log_head << "Starting up..." << endl;
67    
68          // Initialize sockets          // Initialize sockets
69          if(!AfxSocketInit())          if(!AfxSocketInit())
70          {          {
# Line 78  int _tmain(int argc, TCHAR* argv[], TCHA Line 81  int _tmain(int argc, TCHAR* argv[], TCHA
81          if (argc == 2 && _stricmp(argv[1], "-s") == 0)          if (argc == 2 && _stricmp(argv[1], "-s") == 0)
82          {          {
83                  innbbsd_srv.ctrld.InitThreadPool();                  innbbsd_srv.ctrld.InitThreadPool();
                 innbbsd_srv.ctrld.begin();  
                 innbbsd_srv.ctrld.StartupChild();  
84    
85                  while (innbbsd_srv.ctrld.IsRunning())                  if (innbbsd_srv.ctrld.begin() == 0)
86                    {
87                            syslog << logfile::log_head << "Begin CONTROLD ... OK" << endl;
88    
89                            innbbsd_srv.ctrld.StartupChild();
90    
91                            while (innbbsd_srv.ctrld.IsRunning())
92                            {
93                                    Sleep(100);
94                            }
95    
96                            innbbsd_srv.ctrld.ShutdownChild();
97                    }
98                    else
99                  {                  {
100                      Sleep(100);                          syslog << logfile::log_head << "Begin CONTROLD ... Failed" << endl;
101              }                  }
102    
103                    if (innbbsd_srv.ctrld.end() == 0)
104                    {
105                            syslog << logfile::log_head << "End CONTROLD ... OK" << endl;
106                    }
107                    else
108                    {
109                            syslog << logfile::log_head << "End CONTROLD ... Failed" << endl;
110                    }
111    
                 innbbsd_srv.ctrld.ShutdownChild();  
                 innbbsd_srv.ctrld.end();  
112                  innbbsd_srv.ctrld.CleanupThreadPool();                  innbbsd_srv.ctrld.CleanupThreadPool();
113    
114                    ExitProcess(0);
115    
116                  return 0;                  return 0;
117          }          }
118    
119      // Parse for standard arguments (install, uninstall, version etc.)          // Display version infomation
120            if (argc == 2 && _stricmp(argv[1], "-c") == 0)
121            {
122                    cout << App_common::GetVersion() << endl;
123                    cout << App_common::Copyright << endl;
124            }
125    
126            // Parse for standard arguments (install, uninstall, version etc.)
127      if (!innbbsd_srv.ParseStandardArgs(argc, argv)) {      if (!innbbsd_srv.ParseStandardArgs(argc, argv)) {
128          //DebugBreak();          //DebugBreak();
129          innbbsd_srv.StartService();          innbbsd_srv.StartService();


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

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