Back to index

salome-kernel  6.5.0
Functions | Variables
launchSalome Namespace Reference

Functions

def findFreePort

Variables

tuple freePort = findFreePort(2810, 1)
tuple hostName = socket.gethostname()
string omniCfgFileContent = "InitRef = NameService=corbaname::"
tuple omniCfgFilePath = os.environ.get('HOME')
tuple omni_file = file(omniCfgFilePath,'w+')
tuple omniCfgCurrent = os.environ.get('HOME')
tuple runSalomePyFilePath = os.environ.get('KERNEL_ROOT_DIR')

Function Documentation

def launchSalome.findFreePort (   startPort,
  step 
)

Definition at line 31 of file launchSalome.py.

00031 
00032 def findFreePort(startPort, step) :
00033 
00034     currentPort = startPort;
00035     if step < 1:
00036         step = 1;
00037 
00038     serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM);
00039 
00040     portFound = 0;
00041     while (portFound != 1 and currentPort < 65536):
00042         try :
00043             serversocket.bind((socket.gethostname(), currentPort));
00044             portFound = 1;
00045             print str(currentPort) + ": " + "OK";
00046 #            serversocket.shutdown(0);
00047 #            serversocket.close();
00048         except Exception, inst:
00049             print str(currentPort) + ": " + str(inst.args);
00050             currentPort = currentPort+step;
00051     
00052     
00053     
00054     
00055     if (portFound != 1) :
00056         currentPort = -1;
    return currentPort;

Variable Documentation

  1. Generate config file for omniORB: content: InitRef = NameService=corbaname::[HOST_NAME]:[PORT_NUMBER]

Definition at line 65 of file launchSalome.py.

tuple launchSalome.hostName = socket.gethostname()

Definition at line 66 of file launchSalome.py.

Definition at line 86 of file launchSalome.py.

tuple launchSalome.omniCfgCurrent = os.environ.get('HOME')

Definition at line 92 of file launchSalome.py.

string launchSalome.omniCfgFileContent = "InitRef = NameService=corbaname::"

Definition at line 83 of file launchSalome.py.

launchSalome.omniCfgFilePath = os.environ.get('HOME')

Definition at line 84 of file launchSalome.py.

tuple launchSalome.runSalomePyFilePath = os.environ.get('KERNEL_ROOT_DIR')
  1. Set the OMNIORB_CONFIG environment variable 3. execute the file runSalome.py

Definition at line 110 of file launchSalome.py.