/[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.2 by sysadm, Sat Jul 3 05:52:38 2004 UTC Revision 1.5 by sysadm, Mon Aug 2 19:48:17 2004 UTC
# Line 1  Line 1 
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                              */
# Line 20  Line 20 
20  #include ".\innbbsd.h"  #include ".\innbbsd.h"
21  #include ".\service.h"  #include ".\service.h"
22  #include ".\bbs_fun.h"  #include ".\bbs_fun.h"
23    #include ".\App_common.h"
24    
25  #ifdef _DEBUG  #ifdef _DEBUG
26  #define new DEBUG_NEW  #define new DEBUG_NEW
# Line 62  int _tmain(int argc, TCHAR* argv[], TCHA Line 63  int _tmain(int argc, TCHAR* argv[], TCHA
63    
64          syslog.open(app_path + log_file, ios_base::out | ios_base::app);          syslog.open(app_path + log_file, ios_base::out | ios_base::app);
65    
66            // Report program information
67            syslog << "********************" << endl;
68            syslog << App_common::GetVersion() << endl;
69            syslog << App_common::Copyright << endl;
70            syslog << logfile::log_head << "Starting up..." << endl;
71    
72          // Initialize sockets          // Initialize sockets
73          if(!AfxSocketInit())          if(!AfxSocketInit())
74          {          {
# Line 77  int _tmain(int argc, TCHAR* argv[], TCHA Line 84  int _tmain(int argc, TCHAR* argv[], TCHA
84          //Standalone mode          //Standalone mode
85          if (argc == 2 && _stricmp(argv[1], "-s") == 0)          if (argc == 2 && _stricmp(argv[1], "-s") == 0)
86          {          {
87                  innbbsd_srv.ctrld.begin();                  innbbsd_srv.ctrld.InitThreadPool();
88                  innbbsd_srv.ctrld.StartupChild();  
89                    if (innbbsd_srv.ctrld.begin() == 0)
90                    {
91                            syslog << logfile::log_head << "Begin CONTROLD ... OK" << endl;
92    
93                  while (innbbsd_srv.ctrld.IsRunning())                          innbbsd_srv.ctrld.StartupChild();
94    
95                            while (innbbsd_srv.ctrld.IsRunning())
96                            {
97                                    Sleep(100);
98                            }
99    
100                            innbbsd_srv.ctrld.ShutdownChild();
101                    }
102                    else
103                  {                  {
104                      Sleep(100);                          syslog << logfile::log_head << "Begin CONTROLD ... Failed" << endl;
105              }                  }
106    
107                  innbbsd_srv.ctrld.bbsd.end();                  if (innbbsd_srv.ctrld.end() == 0)
108                  innbbsd_srv.ctrld.innd.end();                  {
109                  innbbsd_srv.ctrld.outd.end();                          syslog << logfile::log_head << "End CONTROLD ... OK" << endl;
110                  innbbsd_srv.ctrld.end();                  }
111                    else
112                    {
113                            syslog << logfile::log_head << "End CONTROLD ... Failed" << endl;
114                    }
115    
116                    innbbsd_srv.ctrld.CleanupThreadPool();
117    
118                    ExitProcess(0);
119    
120                  return 0;                  return 0;
121          }          }
122    
123      // Parse for standard arguments (install, uninstall, version etc.)          // Display version infomation
124            if (argc == 2 && _stricmp(argv[1], "-c") == 0)
125            {
126                    cout << App_common::GetVersion() << endl;
127                    cout << App_common::Copyright << endl;
128            }
129    
130            // Parse for standard arguments (install, uninstall, version etc.)
131      if (!innbbsd_srv.ParseStandardArgs(argc, argv)) {      if (!innbbsd_srv.ParseStandardArgs(argc, argv)) {
132          //DebugBreak();          //DebugBreak();
133          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