]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
[EDF-12448] Only search in TCP ports (avoid "oserror [Errno 7] Argument list too...
authorCédric Aguerre <cedric.aguerre@edf.fr>
Mon, 29 Feb 2016 10:40:39 +0000 (11:40 +0100)
committerCédric Aguerre <cedric.aguerre@edf.fr>
Mon, 29 Feb 2016 10:40:39 +0000 (11:40 +0100)
bin/PortManager.py

index 6532587133c7a7d9d0f9d2d2833ef4b0cc7962b3..d324bdebc4735bc13a51c005f599dc942b3f649f 100644 (file)
@@ -90,7 +90,10 @@ def __isNetworkConnectionActiveOnPort(port):
   #        netstat options -l and -t are unavailable
   #        grep command is unavailable
   from subprocess import Popen, PIPE
-  stdout, _ = Popen(['netstat','-an'], stdout=PIPE).communicate()
+  if sys.platform == "win32":
+    stdout, _ = Popen(['netstat','-a','-n','-p tcp'], stdout=PIPE).communicate()
+  else:
+    stdout, _ = Popen(['netstat','-ant'], stdout=PIPE).communicate()
   import StringIO
   buf = StringIO.StringIO(stdout)
   ports = buf.readlines()
@@ -103,6 +106,7 @@ def __isNetworkConnectionActiveOnPort(port):
       if p == port: return True
     except:
       pass
+  return False
 #
 
 def getPort(preferedPort=None):