X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleCatalog%2FSALOME_ModuleCatalog_Server.cxx;h=de5110a03e595010ece4dff01fe0c982b2c0bcdd;hb=2d6920cce12fd2f1e0f62e37957d03ec2b9293d8;hp=a15d547596083c9e65ec16a904cfe451aad5a668;hpb=1f742af859d50d34c63f9dc02f9a705089bf060e;p=modules%2Fkernel.git diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx index a15d54759..de5110a03 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -38,17 +38,16 @@ using namespace std; int main(int argc,char **argv) { + // initialize the ORB + CORBA::ORB_ptr orb = CORBA::ORB_init (argc, argv); + // LocalTraceCollector *myThreadTrace = SALOMETraceCollector::instance(orb); try { CosNaming::NamingContext_var _rootContext, catalogContext; - // initialize the ORB - - CORBA::ORB_ptr orb = CORBA::ORB_init (argc, argv); - // initialize POA // - long TIMESleep = 250000000; + long TIMESleep = 500000000; int NumberOfTries = 40; int a; timespec ts_req; @@ -74,7 +73,11 @@ int main(int argc,char **argv) for (int i = 1; i<=NumberOfTries; i++) { if (i!=1) +#ifndef WNT a=nanosleep(&ts_req,&ts_rem); +#else + Sleep(TIMESleep/1000000); +#endif try { obj = orb->resolve_initial_references("RootPOA"); @@ -85,9 +88,9 @@ int main(int argc,char **argv) if(!CORBA::is_nil(orb)) theObj = orb->resolve_initial_references("NameService"); } - catch( CORBA::COMM_FAILURE& ) + catch( CORBA::SystemException& ) { - INFOS( "Module Catalog Server: CORBA::COMM_FAILURE: Unable to contact the Naming Service" ); + INFOS( "Module Catalog Server: CORBA::SystemException: Unable to contact the Naming Service" ); } if (!CORBA::is_nil(theObj)) { @@ -103,7 +106,11 @@ int main(int argc,char **argv) for(int j=1; j<=NumberOfTries; j++) { if (j!=1) +#ifndef WNT a=nanosleep(&ts_req, &ts_rem); +#else + Sleep(TIMESleep/1000000); +#endif try{ object = inc->resolve(name);} catch(CosNaming::NamingContext::NotFound) @@ -166,5 +173,6 @@ int main(int argc,char **argv) INFOS("Caught CORBA::Exception.") } + // delete myThreadTrace; return 0; }