main.lua 601 B

1234567891011121314151617181920212223
  1. local skynet = require "skynet"
  2. local sprotoloader = require "sprotoloader"
  3. local max_client = 64
  4. skynet.start(function()
  5. skynet.error("Server start")
  6. skynet.uniqueservice("protoloader")
  7. if not skynet.getenv "daemon" then
  8. local console = skynet.newservice("console")
  9. end
  10. skynet.newservice("debug_console",8000)
  11. skynet.newservice("simpledb")
  12. local watchdog = skynet.newservice("watchdog")
  13. local addr,port = skynet.call(watchdog, "lua", "start", {
  14. port = 8888,
  15. maxclient = max_client,
  16. nodelay = true,
  17. })
  18. skynet.error("Watchdog listen on " .. addr .. ":" .. port)
  19. skynet.exit()
  20. end)