checkdeadloop.lua 580 B

12345678910111213141516171819202122232425262728293031
  1. local skynet = require "skynet"
  2. local list = {}
  3. local function timeout_check(ti)
  4. if not next(list) then
  5. return
  6. end
  7. skynet.sleep(ti) -- sleep 10 sec
  8. for k,v in pairs(list) do
  9. skynet.error("timout",ti,k,v)
  10. end
  11. end
  12. skynet.start(function()
  13. skynet.error("ping all")
  14. local list_ret = skynet.call(".launcher", "lua", "LIST")
  15. for addr, desc in pairs(list_ret) do
  16. list[addr] = desc
  17. skynet.fork(function()
  18. skynet.call(addr,"debug","INFO")
  19. list[addr] = nil
  20. end)
  21. end
  22. skynet.sleep(0)
  23. timeout_check(100)
  24. timeout_check(400)
  25. timeout_check(500)
  26. skynet.exit()
  27. end)