Jan-25-2020, 04:37 PM
hello programmers.
I will develop an application to serve as a network tester and one of the parts of this application will be tshark, which is used to monitor packets in the network.
It all works fine, but there is a problem with stopping this process. I use os.kill (PID, SIGKILL) for that.
Do you know why os.kill freezes the whole application ??
thank you for answer
I will develop an application to serve as a network tester and one of the parts of this application will be tshark, which is used to monitor packets in the network.
It all works fine, but there is a problem with stopping this process. I use os.kill (PID, SIGKILL) for that.
def tshark_stop(): out = subprocess.getoutput("ps ax | tshark | grep -v grep").split("\n") for line in out: fields = line.split() pid = fields[0] os.kill(int(pid), signal.SIGKILL)When I try this through the console in the command line, everything works as it should, but when I run this command through my application, the whole application freezes and nothing can be done with it and the only solution is to turn off the whole application and turn it on again. undesirable.
Do you know why os.kill freezes the whole application ??
thank you for answer