def rwsplit(sts, ret, tmbs):
diffs = {}
for idx in sts:
st = sts[idx]
if st.sock is not None:
val = select.POLLIN
if st.ssl_write or st.want_write:
val = val | select.POLLOUT
if ret.get(idx) != val:
ret[idx] = val
diffs[idx] = True
else:
ret[idx] = 0
diffs[idx] = False
if st.want_handle:
plist = tmbs.setdefault(st.partner, [])
while st.want_handle:
tombstone = (st.dequeue(), time.time())
plist.append(tombstone)
return diffs
评论列表
文章目录