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)
评论列表
文章目录