Skip to content
Snippets Groups Projects
Commit adbb0cf3 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

runNonBlockingSubClient()

parent 3a88f23e
No related branches found
No related tags found
No related merge requests found
...@@ -320,7 +320,7 @@ class client : ...@@ -320,7 +320,7 @@ class client :
s = addr.split(':') s = addr.split(':')
self.socket.connect((s[0], int(s[1]))) self.socket.connect((s[0], int(s[1])))
def _waitOnSubClients(self): def waitOnSubClients(self):
if not self.socket : if not self.socket :
return return
while self._numSubClients > 0: while self._numSubClients > 0:
...@@ -328,7 +328,7 @@ class client : ...@@ -328,7 +328,7 @@ class client :
if t == self._GMSH_STOP : if t == self._GMSH_STOP :
self._numSubClients -= 1 self._numSubClients -= 1
def runSubClient(self, name, command, arguments=''): def runNonBlockingSubClient(self, name, command, arguments=''):
# create command line # create command line
if self.action == "check": if self.action == "check":
cmd = command cmd = command
...@@ -339,7 +339,10 @@ class client : ...@@ -339,7 +339,10 @@ class client :
msg = [name, cmd] msg = [name, cmd]
self._send(self._GMSH_CONNECT, '\0'.join(msg)) self._send(self._GMSH_CONNECT, '\0'.join(msg))
self._numSubClients +=1 self._numSubClients +=1
self._waitOnSubClients() # makes the subclient blocking
def runSubClient(self, name, command, arguments=''):
self.runNonBlockingSubClient(name, command, arguments)
self.waitOnSubClients() # makes the subclient blocking
def run(self, name, command, arguments=''): def run(self, name, command, arguments=''):
self.runSubClient(name, command, arguments) self.runSubClient(name, command, arguments)
...@@ -363,7 +366,7 @@ class client : ...@@ -363,7 +366,7 @@ class client :
# code aster python interpreter does not call the destructor at exit, it is # code aster python interpreter does not call the destructor at exit, it is
# necessary to call finalize() epxlicitely # necessary to call finalize() epxlicitely
if self.socket : if self.socket :
self._waitOnSubClients() self.waitOnSubClients()
self._send(self._GMSH_STOP, 'Goodbye!') self._send(self._GMSH_STOP, 'Goodbye!')
self.socket.close() self.socket.close()
self.socket = None self.socket = None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment