mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 12:20:41 +00:00
exit monitor
This commit is contained in:
@@ -4,6 +4,7 @@ skynet.start(function()
|
||||
print("Server start")
|
||||
skynet.launch("socket",128)
|
||||
local service = skynet.newservice("service_mgr")
|
||||
skynet.monitor "simplemonitor"
|
||||
local lualog = skynet.newservice("lualog")
|
||||
local console = skynet.newservice("console")
|
||||
local remoteroot = skynet.newservice("remote_root")
|
||||
|
||||
@@ -2,11 +2,12 @@ local skynet = require "skynet"
|
||||
|
||||
skynet.start(function()
|
||||
print("Log server start")
|
||||
-- local connection = skynet.launch("connection","256")
|
||||
skynet.launch("socket",128)
|
||||
local lualog = skynet.launch("snlua","lualog")
|
||||
local console = skynet.launch("snlua","console")
|
||||
local log = skynet.launch("snlua","globallog")
|
||||
local service = skynet.newservice("service_mgr")
|
||||
skynet.monitor "simplemonitor"
|
||||
local lualog = skynet.newservice("lualog")
|
||||
local console = skynet.newservice("console")
|
||||
local log = skynet.newservice("globallog")
|
||||
-- skynet.launch("snlua","testgroup_c 11 1")
|
||||
skynet.exit()
|
||||
end)
|
||||
|
||||
14
service/simplemonitor.lua
Normal file
14
service/simplemonitor.lua
Normal file
@@ -0,0 +1,14 @@
|
||||
local skynet = require "skynet"
|
||||
|
||||
-- It's a simple service exit monitor, you can do something more when a service exit.
|
||||
|
||||
skynet.register_protocol {
|
||||
name = "client",
|
||||
id = 3,
|
||||
unpack = function() end,
|
||||
dispatch = function(_, address)
|
||||
print(string.format("[:%x] exit", address))
|
||||
end
|
||||
}
|
||||
|
||||
skynet.start(function() end)
|
||||
Reference in New Issue
Block a user