def poll(self, timeout):
rlist, wlist, xlist = select.select(list(self.__descrsRead),
list(self.__descrsWrite),
list(self.__descrsError),
timeout)
allDescrs = set(rlist + wlist + xlist)
rlist = set(rlist)
wlist = set(wlist)
xlist = set(xlist)
for descr in allDescrs:
event = 0
if descr in rlist:
event |= POLL_EVENT_TYPE.READ
if descr in wlist:
event |= POLL_EVENT_TYPE.WRITE
if descr in xlist:
event |= POLL_EVENT_TYPE.ERROR
self.__descrToCallbacks[descr](descr, event)
评论列表
文章目录