def maintern_zombie_channel (now, map = None):
global _killed_zombies
if map is None:
map = asyncore.socket_map
for channel in list(map.values()):
if hasattr (channel, "handle_timeout"):
try:
# +3 is make gap between server & client
iszombie = (now - channel.event_time) > channel.zombie_timeout
except AttributeError:
continue
if iszombie:
_killed_zombies += 1
try:
channel.handle_timeout ()
except:
channel.handle_error ()
评论列表
文章目录