tcping
tcping copied to clipboard
Add flag for success
To code against this library without spawning subprocesses I have to reference internal variables to know if the connection was a success. Having a method to determine success would be helpful.
def do_ping(target, port = 80):
ping = Ping(target, port)
ping.ping(1)
rc = (ping._successed > ping._failed)