(file) Return to cimserver.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Server

Diff for /pegasus/src/Server/cimserver.cpp between version 1.27 and 1.28

version 1.27, 2001/06/19 23:53:41 version 1.28, 2001/06/23 21:42:58
Line 75 
Line 75 
 #include <Pegasus/Protocol/Handler.h> #include <Pegasus/Protocol/Handler.h>
 #include <Pegasus/Common/Logger.h> #include <Pegasus/Common/Logger.h>
 #include <Pegasus/Common/System.h> #include <Pegasus/Common/System.h>
   #include <slp/slp.h>
  
  
  
Line 346 
Line 347 
     // try loop to bind the address, and run the server     // try loop to bind the address, and run the server
     try     try
     {     {
           String serviceURL;
           serviceURL.assign("service:cim.pegasus://");
           char *host_name = slp_get_host_name();
           serviceURL += host_name;
           serviceURL += ":";
           serviceURL += address;
           char *url = serviceURL.allocateCString();
           free(host_name);
   
         Selector selector;         Selector selector;
         CIMServer server(&selector, pegasusHome);         CIMServer server(&selector, pegasusHome);
         server.setSLP(useSLP);  
  
         // bind throws an exception of the bind fails         // bind throws an exception of the bind fails
         server.bind(address);         server.bind(address);
         delete [] address;         delete [] address;
   
           slp_client *discovery = NULL;
           if(useSLP)
             discovery = new slp_client();
   
           time_t last = 0;
           while( 1 )
           {
             if(useSLP  )
             {
               int success, failure;
   
               if(  (time(NULL) - last ) > 60 )
               {
                 if( discovery != NULL && url != NULL )
                   discovery->srv_reg_all(url,
                                          "(namespace=root/cimv20)",
                                          "service:cim.pegasus",
                                          "DEFAULT",
                                          3600) ;
                 time(&last);
               }
             }
         server.runForever();         server.runForever();
           }
  
         Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION,         Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION,
             "Normal Termination");             "Normal Termination");
   
     }     }
     catch(Exception& e)     catch(Exception& e)
     {     {


Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2