version 1.28, 2001/06/23 21:42:58
|
version 1.29, 2001/06/25 17:51:59
|
|
|
// try loop to bind the address, and run the server | // try loop to bind the address, and run the server |
try | try |
{ | { |
|
slp_client *discovery = new slp_client() ;; |
String serviceURL; | String serviceURL; |
serviceURL.assign("service:cim.pegasus://"); | serviceURL.assign("service:cim.pegasus://"); |
char *host_name = slp_get_host_name(); |
String host_name = slp_get_host_name(); |
serviceURL += host_name; | serviceURL += host_name; |
serviceURL += ":"; | serviceURL += ":"; |
serviceURL += address; | serviceURL += address; |
char *url = serviceURL.allocateCString(); | char *url = serviceURL.allocateCString(); |
free(host_name); |
// free(host_name); |
| |
Selector selector; | Selector selector; |
CIMServer server(&selector, pegasusHome); | CIMServer server(&selector, pegasusHome); |
|
|
server.bind(address); | server.bind(address); |
delete [] address; | delete [] address; |
| |
slp_client *discovery = NULL; |
|
if(useSLP) |
|
discovery = new slp_client(); |
|
| |
time_t last = 0; | time_t last = 0; |
while( 1 ) | while( 1 ) |
{ | { |
if(useSLP ) | if(useSLP ) |
{ | { |
int success, failure; |
|
|
|
if( (time(NULL) - last ) > 60 ) | if( (time(NULL) - last ) > 60 ) |
{ | { |
if( discovery != NULL && url != NULL ) | if( discovery != NULL && url != NULL ) |
|
|
"(namespace=root/cimv20)", | "(namespace=root/cimv20)", |
"service:cim.pegasus", | "service:cim.pegasus", |
"DEFAULT", | "DEFAULT", |
3600) ; |
70) ; |
time(&last); | time(&last); |
} | } |
|
|
|
discovery->service_listener(); |
} | } |
server.runForever(); | server.runForever(); |
} | } |