+bool parse_init_port(const std::string& input, std::string& node, std::string& port, std::string& value)
+{
+ bool ok = true;
+ size_t pos_eq = input.find('=');
+ if(pos_eq == std::string::npos || pos_eq == input.size())
+ return false;
+ value = input.substr(pos_eq+1);
+ size_t pos_dot = input.rfind('.', pos_eq);
+ if(!pos_dot || pos_dot == std::string::npos || pos_dot >= pos_eq-1)
+ return false;
+ port = input.substr(pos_dot+1, pos_eq-pos_dot-1);
+ node = input.substr(0, pos_dot);
+ return true;
+}
+
+void InitializeSSL()
+{
+ setSSLMode(true);
+ KERNEL::getLauncherSA();
+}
+
+void shutdownServers()
+{
+ // shutdown data server scopes
+ try
+ {
+ YACS::ENGINE::RuntimeSALOME* runTime = YACS::ENGINE::getSALOMERuntime();
+ runTime->loadModulCatalog();
+ CORBA::ORB_ptr orb = runTime->getOrb();
+ if (orb)
+ {
+ SALOME_NamingService_Wrapper namingService(orb);
+ CORBA::Object_var objDSM(namingService.Resolve(SALOMESDS::DataServerManager::NAME_IN_NS));
+ SALOME::DataServerManager_var dsm(SALOME::DataServerManager::_narrow(objDSM));
+ if ( !CORBA::is_nil(dsm) )
+ dsm->shutdownScopes();
+ }
+ }
+ catch(const CORBA::Exception& )
+ {
+ // ignore and continue
+ }
+ catch(ServiceUnreachable& e)
+ {
+ // ignore and continue
+ }
+}