mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 12:43:09 +00:00
minor optimize
This commit is contained in:
@@ -33,11 +33,9 @@ local node_channel = setmetatable({}, { __index = open_channel })
|
|||||||
function command.listen(source, addr, port)
|
function command.listen(source, addr, port)
|
||||||
local gate = skynet.newservice("gate")
|
local gate = skynet.newservice("gate")
|
||||||
if port == nil then
|
if port == nil then
|
||||||
local host, port = string.match(node_address[addr], "([^:]+):(.*)$")
|
addr, port = string.match(node_address[addr], "([^:]+):(.*)$")
|
||||||
skynet.call(gate, "lua", "open", { address = host, port = port })
|
|
||||||
else
|
|
||||||
skynet.call(gate, "lua", "open", { address = addr, port = port })
|
|
||||||
end
|
end
|
||||||
|
skynet.call(gate, "lua", "open", { address = addr, port = port })
|
||||||
skynet.ret(skynet.pack(nil))
|
skynet.ret(skynet.pack(nil))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user