From 6fe520a7cb260037b3a2bc68bd76c3fc49d87bf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=81=E5=A4=A7=E9=BE=99?= <6268385+dingdalong@users.noreply.github.com> Date: Sat, 18 Feb 2023 00:57:39 +0800 Subject: [PATCH] =?UTF-8?q?=20cluster.open=E6=B7=BB=E5=8A=A0maxclient?= =?UTF-8?q?=E5=8F=82=E6=95=B0=20(#1705)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lualib/skynet/cluster.lua | 6 +++--- service/clusterd.lua | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lualib/skynet/cluster.lua b/lualib/skynet/cluster.lua index e3437b43..025ea016 100644 --- a/lualib/skynet/cluster.lua +++ b/lualib/skynet/cluster.lua @@ -75,11 +75,11 @@ function cluster.send(node, address, ...) end end -function cluster.open(port) +function cluster.open(port, maxclient) if type(port) == "string" then - return skynet.call(clusterd, "lua", "listen", port) + return skynet.call(clusterd, "lua", "listen", port, nil, maxclient) else - return skynet.call(clusterd, "lua", "listen", "0.0.0.0", port) + return skynet.call(clusterd, "lua", "listen", "0.0.0.0", port, maxclient) end end diff --git a/service/clusterd.lua b/service/clusterd.lua index 20faedfa..44729966 100644 --- a/service/clusterd.lua +++ b/service/clusterd.lua @@ -142,17 +142,17 @@ function command.reload(source, config) skynet.ret(skynet.pack(nil)) end -function command.listen(source, addr, port) +function command.listen(source, addr, port, maxclient) local gate = skynet.newservice("gate") if port == nil then local address = assert(node_address[addr], addr .. " is down") addr, port = string.match(address, "(.+):([^:]+)$") port = tonumber(port) assert(port ~= 0) - skynet.call(gate, "lua", "open", { address = addr, port = port }) + skynet.call(gate, "lua", "open", { address = addr, port = port, maxclient = maxclient }) skynet.ret(skynet.pack(addr, port)) else - local realaddr, realport = skynet.call(gate, "lua", "open", { address = addr, port = port }) + local realaddr, realport = skynet.call(gate, "lua", "open", { address = addr, port = port, maxclient = maxclient }) skynet.ret(skynet.pack(realaddr, realport)) end end