nbNetBase.py 文件源码

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

项目:Starfish 作者: BillWang139967 项目源码 文件源码
def run(self):
        '''????
        ??epoll????????
        '''
        while True:
            # epoll??????????????????????????????????????????
            # ?????????epoll???????
            epoll_list = self.epoll_sock.poll()
            for fd, events in epoll_list:
                logs.dblog("epoll: epoll find fd(%s) have signal" % fd)
                sock_state = self.conn_state[fd]
                # ?? epoll?????io?? epoll hang??????
                if select.EPOLLHUP & events:
                    sock_state.state = "closing"
                # ??IO??epoll?????????
                elif select.EPOLLERR & events:
                    sock_state.state = "closing"
                logs.dblog("epoll: use state_machine process fd(%s)" % fd)
                self.state_machine(fd)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号