Personal tools
You are here: Home Forum Install & build Replace netstat code

Replace netstat code

Up to Install & build

Replace netstat code

Posted by Niels Nielsen at July 28. 2020

Netstat is not part of all OS's anymore.

It is used to check for a free port.

I recommend switching the code in to just use plain sockets. btw this is using Salome 9.5.0


def __isNetworkConnectionActiveOnPort(port):
  sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  result = sock.connect_ex(("", port))

  if result == 0:
    print("Port %r:      Closed" % (port))
    return True
    return False


Also the option for nameserver in is deprecated, line 92.

Instead of "--all-ip-addresses" it should be "--ip-addresses"

Making these two changes makes the Generic linux version of Salome run fine in Solus OS 4.1

Powered by Ploneboard
Document Actions