########## kills all salome processes with the given port ##########
-def shutdownMyPort(port):
+def shutdownMyPort(port, cleanup=True):
"""
Shutdown SALOME session running on the specified port.
Parameters:
with_port=port,
**kwargs)
os.environ['OMNIORB_CONFIG'] = omniorb_config
- os.environ['NSPORT'] = port
+ os.environ['NSPORT'] = str(port)
# give the chance to the servers to shutdown properly
try:
# give some time to shutdown to complete
time.sleep(1)
# shutdown omniNames and notifd
- lcc.killOmniNames()
- time.sleep(1)
+ if cleanup:
+ lcc.killOmniNames()
+ time.sleep(1)
+ pass
+ pass
except:
pass
pass
# try to shutdown session nomally
import threading, time
- threading.Thread(target=shutdownMyPort, args=(port,)).start()
+ threading.Thread(target=shutdownMyPort, args=(port,False)).start()
time.sleep(3) # wait a little, then kill processes (should be done if shutdown procedure hangs up)
# new-style dot-prefixed pidict file
return int( os.getenv( "NSPORT" ) )
except:
pass
- port = getPortFromORBcfg()
- if port is not None: return port
+ try:
+ port = int( getPortFromORBcfg() )
+ if port is not None: return port
+ except:
+ pass
if use_default: return 2809 # '2809' is default port number
return None