From f7116996b9ef393d97626dcac5ee8583d072b162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91?= <273461474@qq.com> Date: Tue, 11 Feb 2025 18:00:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=8E=B7=E5=8F=96socket=5Fpo?= =?UTF-8?q?ol=E4=B8=AD=E6=89=80=E6=9C=89id=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lualib/skynet/socket.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lualib/skynet/socket.lua b/lualib/skynet/socket.lua index b4c0fb271..356424667 100644 --- a/lualib/skynet/socket.lua +++ b/lualib/skynet/socket.lua @@ -483,6 +483,14 @@ function socket.udp_dial(addr, port, callback) return id end +function socket.list_socket_pool() + local ret = {} + for id,_ in pairs(socket_pool) do + table.insert(ret,id) + end + return ret +end + socket.sendto = assert(driver.udp_send) socket.udp_address = assert(driver.udp_address) socket.netstat = assert(driver.info)