Salome HOME
Test EXPORTS definition with target name as suggested by cmake
[modules/kernel.git] / src / NamingService / NamingService_WaitForServerReadiness.cxx
index 7cb1a6bce9dafd1f889274d554bb8fcd2c985548..deab8d1a95e8717e477f6c04a9db30beabce151b 100644 (file)
@@ -1,29 +1,29 @@
-//  Copyright (C) 2004  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  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 
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : NamingService_WaitForServerReadiness.cxx
 //  Author : Paul RASCLE (EDF)
 //  Module : KERNEL
 //  $Header$
-
+//
 #include "NamingService_WaitForServerReadiness.hxx"
 #include "utilities.h"
 #include <iostream>
@@ -66,26 +66,34 @@ void NamingService_WaitForServerReadiness(SALOME_NamingService* NS,
        {
          if (serverName.length() == 0)
            {
-             string curdir = NS->Current_Directory(); // to wait for naming service
+              CORBA::String_var dummyadr = NS->getIORaddr(); // to wait for naming service
              found = 1;
              break; // naming service found
            }
          else
            {
-             CORBA::Object_ptr obj = NS->Resolve(serverName.c_str());
+             CORBA::Object_var obj = NS->Resolve(serverName.c_str());
              if (! CORBA::is_nil(obj))
                {
                  found =1;
                  break; // server found, no more try to do
                }
              MESSAGE("Server "<< serverName <<" not yet ready, waiting...");
-             int a = nanosleep(&ts_req,&ts_rem); // wait before retry
+#ifndef WIN32
+              nanosleep(&ts_req,&ts_rem); // wait before retry
+#else
+              Sleep(TIMESleep/1000000);
+#endif
            }
        }
       catch( ServiceUnreachable& )
        {
          MESSAGE("CORBA::COMM_FAILURE: Naming Service not yet ready, waiting...");
-         int a = nanosleep(&ts_req,&ts_rem); // wait before retry
+#ifndef WIN32
+          nanosleep(&ts_req,&ts_rem); // wait before retry
+#else
+          Sleep(TIMESleep/1000000);
+#endif
        }
     }
   if (!found)