From 6bfefd9207a003d941df1e2dece9bf446d3acaa6 Mon Sep 17 00:00:00 2001 From: liaozhaoyan Date: Thu, 20 Jul 2023 09:55:20 +0800 Subject: [PATCH] add outLine option. --- .../unity/collector/outline/pipeMon.lua | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/source/tools/monitor/unity/collector/outline/pipeMon.lua b/source/tools/monitor/unity/collector/outline/pipeMon.lua index 81f20696..ba26bf0c 100644 --- a/source/tools/monitor/unity/collector/outline/pipeMon.lua +++ b/source/tools/monitor/unity/collector/outline/pipeMon.lua @@ -35,20 +35,22 @@ end function CpipeMon:setupPipe(fYaml) local res = system:parseYaml(fYaml) - for i, path in ipairs(res.outline) do - if unistd.access(path) then - unistd.unlink(path) - end - self._paths[i] = path - - socket.unix = require("socket.unix") - local s = socket.unix.udp() - if s then - s:bind(path) - print("bind " .. path) - table.insert(self._socks, s) - else - error("create udp pipe failed.") + if res.outline then + for i, path in ipairs(res.outline) do + if unistd.access(path) then + unistd.unlink(path) + end + self._paths[i] = path + + socket.unix = require("socket.unix") + local s = socket.unix.udp() + if s then + s:bind(path) + print("bind " .. path) + table.insert(self._socks, s) + else + error("create udp pipe failed.") + end end end end -- Gitee