帮助我跟踪特定端口的状态:"LISTENING","CLOSE_WAIT","ESTABLISHED".我有一个使用netstat命令的模拟解决方案:
local command = 'netstat -anp tcp | find ":1926 " '
local h = io.popen(command,"rb")
local result = h:read("*a")
h:close()
print(result)
if result:find("ESTABLISHED") then
print("Ok")
end
Run Code Online (Sandbox Code Playgroud)
但是我需要对Lua套接字库做同样的事情.可能吗?