前段时间,项目里用到python-nfqueue,但是遇到一个问题,当网卡里没有数据时,监控线程被阻塞。话不多说,先来一段代码:
t2 = threading.Thread(target=self.start_nfqueue) t2.daemon = True t2.start() ### 启动nfqueue p = threading.Thread(target=self.check_dev_status, args=('130.0.0.50', 7313)) p.daemon = True p.start() ### 启动监控线程