version 1.113, 2003/10/10 15:34:27
|
version 1.116, 2003/10/15 19:29:59
|
|
|
#include <Pegasus/Client/CIMClient.h> | #include <Pegasus/Client/CIMClient.h> |
#include <Pegasus/Server/ShutdownService.h> | #include <Pegasus/Server/ShutdownService.h> |
#include <Pegasus/Common/Destroyer.h> | #include <Pegasus/Common/Destroyer.h> |
#if !defined(PEGASUS_OS_ZOS) && ! defined(PEGASUS_OS_HPUX) && ! defined(PEGASUS_NO_SLP) |
|
#include <slp/slp.h> |
|
#endif |
|
| |
| |
#if defined(PEGASUS_OS_TYPE_WINDOWS) | #if defined(PEGASUS_OS_TYPE_WINDOWS) |
|
|
{ | { |
String pegasusHome = String::EMPTY; | String pegasusHome = String::EMPTY; |
String logsDirectory = String::EMPTY; | String logsDirectory = String::EMPTY; |
Boolean useSLP = false; |
|
Boolean daemonOption = false; | Boolean daemonOption = false; |
Boolean shutdownOption = false; | Boolean shutdownOption = false; |
Uint32 timeoutValue = 0; | Uint32 timeoutValue = 0; |
|
|
cout << MessageLoader::getMessage(parms) << logsDirectory << endl; | cout << MessageLoader::getMessage(parms) << logsDirectory << endl; |
#endif | #endif |
| |
if (String::equal(configManager->getCurrentValue("slp"), "true")) |
|
{ |
|
useSLP = true; |
|
} |
|
} | } |
catch (UnrecognizedConfigProperty e) | catch (UnrecognizedConfigProperty e) |
{ | { |
|
|
"Built $0 $1\nStarting...", | "Built $0 $1\nStarting...", |
__DATE__, | __DATE__, |
__TIME__); | __TIME__); |
cout << MessageLoader::getMessage(parms) |
|
<< (useSLP ? " SLP reg. " : " No SLP ") |
|
<< endl; |
|
#endif | #endif |
| |
//l10n | //l10n |
|
|
// try loop to bind the address, and run the server | // try loop to bind the address, and run the server |
try | try |
{ | { |
#if !defined(PEGASUS_OS_ZOS) && ! defined(PEGASUS_OS_HPUX) && ! defined(PEGASUS_NO_SLP) |
|
char slp_address[32]; |
|
slp_client *discovery = new slp_client() ;; |
|
String serviceURL; |
|
serviceURL.assign("service:cim.pegasus://"); |
|
String host_name = slp_get_host_name(); |
|
serviceURL.append(host_name); |
|
serviceURL.append(":"); |
|
// ATTN: Fix this to work for multiple connections |
|
sprintf(slp_address, "%u", |
|
enableHttpConnection ? portNumberHttp : portNumberHttps); |
|
serviceURL.append(slp_address); |
|
#endif |
|
| |
| |
| |
| |
#if defined(PEGASUS_OS_OS400) || defined(PEGASUS_MONITOR2) |
|
CIMServer server(monitor_2::get_monitor2()); |
#if defined(PEGASUS_MONITOR2) |
|
monitor_2 monitor; |
|
CIMServer server(&monitor); |
#else | #else |
| |
Monitor monitor(true); | Monitor monitor(true); |
|
|
// | // |
while( !server.terminated() ) | while( !server.terminated() ) |
{ | { |
#if !defined(PEGASUS_OS_ZOS) && ! defined(PEGASUS_OS_HPUX) && ! defined(PEGASUS_NO_SLP) |
|
if(useSLP ) |
|
{ |
|
if( (time(NULL) - last ) > 60 ) |
|
{ |
|
if( discovery != NULL && serviceURL.size() ) |
|
discovery->srv_reg_all(serviceURL.getCString(), |
|
"(namespace=root/cimv2)", |
|
"service:cim.pegasus", |
|
"DEFAULT", |
|
70) ; |
|
time(&last); |
|
} |
|
| |
discovery->service_listener(); |
|
} |
|
#endif |
|
server.runForever(); | server.runForever(); |
| |
} | } |