lifetime.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:aquests 作者: hansroh 项目源码 文件源码
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 ()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号