minor optimize

This commit is contained in:
Cloud Wu
2014-06-19 16:29:54 +08:00
parent d0468a39f4
commit e4197daa54

View File

@@ -33,11 +33,9 @@ local node_channel = setmetatable({}, { __index = open_channel })
function command.listen(source, addr, port)
local gate = skynet.newservice("gate")
if port == nil then
local host, 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 })
addr, port = string.match(node_address[addr], "([^:]+):(.*)$")
end
skynet.call(gate, "lua", "open", { address = addr, port = port })
skynet.ret(skynet.pack(nil))
end