throw error when skynet.exit

This commit is contained in:
Cloud Wu
2014-07-03 17:40:07 +08:00
parent 711c04e6a9
commit f874fdc618
5 changed files with 17 additions and 3 deletions

View File

@@ -253,6 +253,13 @@ end
function skynet.exit()
skynet.send(".launcher","lua","REMOVE",skynet.self())
for co, session in pairs(session_coroutine_id) do
local address = session_coroutine_address[co]
local self = skynet.self()
if session~=0 and address then
skynet.redirect(self, address, "error", session, "")
end
end
c.command("EXIT")
end