def monitor_retransmit():
global proc
with proc.stdout:
for line in iter (proc.stdout.readline, b''):
if stop_flag:
break
tokens = line.split()
if len(tokens) < 5 or (tokens[2] == '-:-' and tokens[4] == '-:-') \
or tokens[0] == "TIME":
continue
key = tokens[1] + ':' + tokens[3] + ':6'
mon_lock.acquire()
if key not in mon_flows:
print "updating mon_flows", key
mon_flows.update ({key: 1})
mon_lock.release()
os.kill (proc.pid, signal.SIGTERM)
proc.wait() # wait for the subprocess to exit
proc = None
评论列表
文章目录