mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-23 19:43:09 +00:00
exit monitor
This commit is contained in:
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