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 PortManager.py 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(("127.0.0.1", port))

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

 

Also the option for nameserver in nameserver.py 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

Attachments
Powered by Ploneboard
Document Actions