aDTN.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:aDTN-python 作者: megfault 项目源码 文件源码
def start(self):
        """
        Run the aDTN network functionality in two threads, one for sending and the other for receiving. Received
        Ethernet frames are filtered for ethertype and processed if they match the 0xcafe type. The sending thread runs
        a scheduler for periodic sending of aDTN packets.
        """
        self._start_time = time()
        self._sent_pkt_counter = 0
        self._received_pkt_counter = 0
        self._decrypted_pkt_counter = 0
        self._prepare_sending_pool()
        self._scheduler.enter(self._sending_freq, 1, self._send)
        self._sniffing = True
        self._thread_receive = Thread(target=self._sniff, name="ReceivingThread")
        self._sending = True
        self._thread_send = Thread(target=self._scheduler.run, name="SendingThread", kwargs={"blocking": True})
        log_network("start-{}-{}".format(self._batch_size, self._sending_freq))
        self._thread_receive.start()
        sleep(5)
        self._thread_send.start()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号