version 1.33, 2007/06/22 17:35:54
|
version 1.35, 2007/07/02 01:47:05
|
|
|
#include <Pegasus/Common/PegasusAssert.h> | #include <Pegasus/Common/PegasusAssert.h> |
#include <fstream> | #include <fstream> |
#include <Pegasus/Common/FileSystem.h> | #include <Pegasus/Common/FileSystem.h> |
#include <Pegasus/Common/Monitor.h> |
|
#include <Pegasus/Common/PegasusVersion.h> | #include <Pegasus/Common/PegasusVersion.h> |
#include <Pegasus/Common/Logger.h> | #include <Pegasus/Common/Logger.h> |
#include <Pegasus/Common/System.h> | #include <Pegasus/Common/System.h> |
|
|
PEGASUS_PROCESS_NAME, PEGASUS_CIMSERVER_START_FILE); | PEGASUS_PROCESS_NAME, PEGASUS_CIMSERVER_START_FILE); |
AutoPtr<CIMServerProcess> _cimServerProcess(new CIMServerProcess()); | AutoPtr<CIMServerProcess> _cimServerProcess(new CIMServerProcess()); |
static CIMServer* _cimServer = 0; | static CIMServer* _cimServer = 0; |
static Monitor* _monitor = 0; |
|
| |
// | // |
// The command name. | // The command name. |
|
|
static const char OPTION_BINDVERBOSE = 'X'; | static const char OPTION_BINDVERBOSE = 'X'; |
#endif | #endif |
| |
static const String PROPERTY_TIMEOUT = "shutdownTimeout"; |
|
|
|
ConfigManager* configManager; |
|
|
|
/** GetOptions function - This function defines the Options Table | /** GetOptions function - This function defines the Options Table |
and sets up the options from that table using the config manager. | and sets up the options from that table using the config manager. |
| |
|
|
//We need to delete the _cimServer reference on exit in order for the destructors to get called. | //We need to delete the _cimServer reference on exit in order for the destructors to get called. |
void deleteCIMServer() | void deleteCIMServer() |
{ | { |
if (_cimServer) |
|
{ |
|
delete _cimServer; | delete _cimServer; |
_cimServer = 0; | _cimServer = 0; |
} | } |
| |
if (_monitor) |
|
{ |
|
delete _monitor; |
|
} |
|
} |
|
|
|
// l10n | // l10n |
// | // |
// Dummy function for the Thread object associated with the initial thread. | // Dummy function for the Thread object associated with the initial thread. |
|
|
// | // |
// Get an instance of the Config Manager. | // Get an instance of the Config Manager. |
// | // |
configManager = ConfigManager::getInstance(); |
ConfigManager* configManager = ConfigManager::getInstance(); |
configManager->useConfigFiles = true; | configManager->useConfigFiles = true; |
| |
// | // |
|
|
// try loop to bind the address, and run the server | // try loop to bind the address, and run the server |
try | try |
{ | { |
_monitor = new Monitor(); |
_cimServer = new CIMServer(); |
_cimServer = new CIMServer(_monitor); |
|
| |
| |
if (enableHttpConnection) | if (enableHttpConnection) |
{ | { |
_cimServer->addAcceptor(false, portNumberHttp, false); |
#ifdef PEGASUS_ENABLE_IPV6 |
|
_cimServer->addAcceptor(HTTPAcceptor::IPV6_CONNECTION, |
|
portNumberHttp, false); |
|
#endif |
|
|
|
#if !defined (PEGASUS_ENABLE_IPV6) || defined (PEGASUS_OS_TYPE_WINDOWS) |
|
_cimServer->addAcceptor(HTTPAcceptor::IPV4_CONNECTION, |
|
portNumberHttp, false); |
|
#endif |
| |
Logger::put_l( | Logger::put_l( |
Logger::STANDARD_LOG, System::CIMSERVER, Logger::INFORMATION, | Logger::STANDARD_LOG, System::CIMSERVER, Logger::INFORMATION, |
|
|
| |
if (enableHttpsConnection) | if (enableHttpsConnection) |
{ | { |
_cimServer->addAcceptor(false, portNumberHttps, true); |
#ifdef PEGASUS_ENABLE_IPV6 |
|
_cimServer->addAcceptor(HTTPAcceptor::IPV6_CONNECTION, |
|
portNumberHttps, true); |
|
#endif |
|
|
|
#if !defined (PEGASUS_ENABLE_IPV6) || defined (PEGASUS_OS_TYPE_WINDOWS) |
|
_cimServer->addAcceptor(HTTPAcceptor::IPV4_CONNECTION, |
|
portNumberHttps, true); |
|
#endif |
| |
Logger::put_l( | Logger::put_l( |
Logger::STANDARD_LOG, System::CIMSERVER, Logger::INFORMATION, | Logger::STANDARD_LOG, System::CIMSERVER, Logger::INFORMATION, |
|
|
} | } |
| |
#ifndef PEGASUS_DISABLE_LOCAL_DOMAIN_SOCKET | #ifndef PEGASUS_DISABLE_LOCAL_DOMAIN_SOCKET |
_cimServer->addAcceptor(true, 0, false, false); |
_cimServer->addAcceptor(HTTPAcceptor::LOCAL_CONNECTION, 0, false); |
|
|
Logger::put_l( | Logger::put_l( |
Logger::STANDARD_LOG, System::CIMSERVER, Logger::INFORMATION, | Logger::STANDARD_LOG, System::CIMSERVER, Logger::INFORMATION, |
"src.Server.cimserver.LISTENING_ON_LOCAL", | "src.Server.cimserver.LISTENING_ON_LOCAL", |