def run(self):
while True:
dbgPrint("\n -- run func loop")
for i in self.conn_state.iterkeys():
dbgPrint("\n -- state of fd: %d" % i)
self.conn_state[i].printState();
epoll_list = self.epoll_sock.poll()
for fd, events in epoll_list:
dbgPrint("\n-- run epoll return fd: %d, event: %s" %(fd, events))
sock_state = self.conn_state[fd]
if select.EPOLLHUP & events:
dbgPrint("events EPOLLHUP")
sock_state.state = "closing"
elif select.EPOLLERR & events:
dbgPrint("EPOLLERROR")
sock_state.state = "closing"
self.state_machine(fd)
评论列表
文章目录