def lifetime_loop (timeout = 30.0, count = 0):
global _last_maintern
global _maintern_interval
loop = 0
map = asyncore.socket_map
while map and _shutdown_phase == 0:
poll_fun_wrap (timeout, map)
now = time.time()
if (now - _last_maintern) > _maintern_interval:
maintern (now)
_last_maintern = time.time ()
loop += 1
if count and loop > count:
break
评论列表
文章目录