version 1.34.2.8, 2001/08/28 15:20:23
|
version 1.34.2.9, 2001/09/13 18:01:40
|
|
|
| |
| |
#include <iostream> | #include <iostream> |
|
#include <cassert> |
#include <cstdlib> | #include <cstdlib> |
#include <Pegasus/Common/FileSystem.h> | #include <Pegasus/Common/FileSystem.h> |
#include <Pegasus/Common/Monitor.h> | #include <Pegasus/Common/Monitor.h> |
|
|
#include <Pegasus/Common/System.h> | #include <Pegasus/Common/System.h> |
#include <Pegasus/Common/Tracer.h> | #include <Pegasus/Common/Tracer.h> |
#include <Pegasus/Config/ConfigManager.h> | #include <Pegasus/Config/ConfigManager.h> |
|
#ifndef PEGASUS_OS_ZOS |
#include <slp/slp.h> | #include <slp/slp.h> |
|
#endif |
| |
| |
#if defined(PEGASUS_OS_TYPE_WINDOWS) | #if defined(PEGASUS_OS_TYPE_WINDOWS) |
|
|
// try loop to bind the address, and run the server | // try loop to bind the address, and run the server |
try | try |
{ | { |
|
#ifndef PEGASUS_OS_ZOS |
slp_client *discovery = new slp_client() ;; | slp_client *discovery = new slp_client() ;; |
String serviceURL; | String serviceURL; |
serviceURL.assign("service:cim.pegasus://"); | serviceURL.assign("service:cim.pegasus://"); |
|
|
serviceURL += address; | serviceURL += address; |
char *url = serviceURL.allocateCString(); | char *url = serviceURL.allocateCString(); |
// free(host_name); | // free(host_name); |
|
#endif |
| |
Monitor monitor; | Monitor monitor; |
CIMServer server(&monitor, pegasusHome); | CIMServer server(&monitor, pegasusHome); |
|
|
time_t last = 0; | time_t last = 0; |
while( 1 ) | while( 1 ) |
{ | { |
|
#ifndef PEGASUS_OS_ZOS |
if(useSLP ) | if(useSLP ) |
{ | { |
if( (time(NULL) - last ) > 60 ) | if( (time(NULL) - last ) > 60 ) |
|
|
| |
discovery->service_listener(); | discovery->service_listener(); |
} | } |
|
#endif |
server.runForever(); | server.runForever(); |
} | } |
| |