watchdog returns addr,port

This commit is contained in:
Cloud Wu
2022-09-04 14:22:13 +08:00
parent 01314de8e1
commit b61daaccf1
5 changed files with 33 additions and 6 deletions

View File

@@ -12,11 +12,11 @@ skynet.start(function()
skynet.newservice("debug_console",8000)
skynet.newservice("simpledb")
local watchdog = skynet.newservice("watchdog")
skynet.call(watchdog, "lua", "start", {
local addr,port = skynet.call(watchdog, "lua", "start", {
port = 8888,
maxclient = max_client,
nodelay = true,
})
skynet.error("Watchdog listen on", 8888)
skynet.error("Watchdog listen on " .. addr .. ":" .. port)
skynet.exit()
end)

View File

@@ -40,7 +40,7 @@ function SOCKET.data(fd, msg)
end
function CMD.start(conf)
skynet.call(gate, "lua", "open" , conf)
return skynet.call(gate, "lua", "open" , conf)
end
function CMD.close(fd)