mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 03:53:09 +00:00
bugfix: newservice
This commit is contained in:
@@ -251,7 +251,11 @@ end
|
||||
function skynet.newservice(name, ...)
|
||||
local param = table.concat({"snlua", name, ...}, " ")
|
||||
local handle = skynet.call(".launcher", "text" , param)
|
||||
return handle
|
||||
if handle == "" then
|
||||
return nil
|
||||
else
|
||||
return string_to_handle(handle)
|
||||
end
|
||||
end
|
||||
|
||||
local function group_command(cmd, handle, address)
|
||||
|
||||
@@ -49,7 +49,7 @@ skynet.start(function()
|
||||
-- init notice
|
||||
local reply = instance[address]
|
||||
if reply then
|
||||
skynet.redirect(reply.address , 0, "response", reply.session, skynet.pack(address))
|
||||
skynet.redirect(reply.address , 0, "response", reply.session, skynet.address(address))
|
||||
instance[address] = nil
|
||||
end
|
||||
else
|
||||
@@ -60,7 +60,7 @@ skynet.start(function()
|
||||
services[inst] = cmd
|
||||
instance[inst] = { session = session, address = address }
|
||||
else
|
||||
skynet.ret(skynet.pack(nil))
|
||||
skynet.ret("")
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user