Salome HOME
updated copyright message
[modules/kernel.git] / src / Launcher / SALOME_ExternalServerHandler.cxx
index ddda9a766eae710e62527756b8416caeee8de1bc..ba75e24c702da7b6e37a936afbfa857bf3a1cdf3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2019  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2019-2023  CEA, EDF, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -36,7 +36,7 @@
 
 unsigned SALOME_ExternalServerHandler::CNT = 0;
 
-SALOME_ExternalServerHandler::SALOME_ExternalServerHandler(SALOME_ExternalServerLauncher *boss, const std::string& name, SALOME_NamingService *ns, long pid):_name(name),_pid(pid),_NS(ns),_boss(boss)
+SALOME_ExternalServerHandler::SALOME_ExternalServerHandler(SALOME_ExternalServerLauncher *boss, const std::string& name, SALOME_NamingService_Abstract *ns, long pid):_name(name),_pid(pid),_NS(ns),_boss(boss)
 {
 }
 
@@ -61,13 +61,18 @@ char *SALOME_ExternalServerHandler::getName()
   return CORBA::string_dup(_name.c_str());
 }
 
-void SALOME_ExternalServerHandler::killMe()
+void SALOME_ExternalServerHandler::KillPID(long pid)
 {
 #ifndef WIN32
-  kill(_pid,SIGTERM);//SIGTERM is emitted not SIGKILL to give _pid process a chance to trap it.
+  kill(pid,SIGTERM);//SIGTERM is emitted not SIGKILL to give _pid process a chance to trap it.
 #endif
 }
 
+void SALOME_ExternalServerHandler::killMe()
+{
+  KillPID(_pid);
+}
+
 void SALOME_ExternalServerHandler::ping()
 {
 #ifndef WIN32
@@ -122,7 +127,7 @@ SALOME::LongVec *SALOME_ExternalServerHandler::listOfChildrenPID()
   std::vector<long> pids(pyh->evalVL(oss.str()));
   std::size_t sz(pids.size());
   ret->length(sz);
-  for(auto i=0;i<sz;i++)
+  for(size_t i=0;i<sz;i++)
     (*ret)[i] = pids[i];
 #endif
   return ret;