-// 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
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)
{
}
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
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;