CPPSERV


Home Projects Jobs Clientele Contact
CPPSERV Documentation Download TODO Mailing lists Bug tracker News RSS Feed Browse source

cservdemon.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2004 by Ilya A. Volynets-Evenbakh                       *
00003  *   ilya@total-knowledge.com                                              *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 #ifndef CSERVIMPLCSERVDEMON_H
00021 #define CSERVIMPLCSERVDEMON_H
00022 
00023 #include <signal.h>
00024 #include "serverconfig/xmlserverconfig.h"
00025 
00026 namespace container {
00027 
00028 //Forward declaration
00029 class RequestDispatcher;
00033 class CServDemon
00034 {
00035 public:
00036     CServDemon();
00037     ~CServDemon();
00038     void parseOptions(int argc, char** argv);
00039     void start();
00040 private:
00041     void run();
00042     static void handleSig11(int signum,siginfo_t* info, void* par);
00043     static void handleTermSig(int signum,siginfo_t* info, void* par);
00044     static void supervisorTerm(int signum,siginfo_t* info, void* par);
00045     static void help();
00046     void setConfigPath(const char*);
00047 private:
00048     serverconfig::XMLServerConfig m_conf;
00049     std::string m_cinName, m_coutName, m_cerrName;
00050     bool m_detach; //Derived classes may set this in parseOptions
00051     int m_pidF;
00052     std::string m_pidFPath;
00053     bool m_lockedPidFile;
00054 };
00055 
00056 }
00057 
00058 #endif

SourceForge.net Logo