From ae15376db2c1b2497b01589c5ec810ab0511560b Mon Sep 17 00:00:00 2001 From: zhangmeng <775834166@qq.com> Date: 星期二, 07 五月 2019 10:13:33 +0800 Subject: [PATCH] push code --- analysis/main.go | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/analysis/main.go b/analysis/main.go index 43ca24f..98269d6 100644 --- a/analysis/main.go +++ b/analysis/main.go @@ -10,6 +10,8 @@ var ( streamURL string picFolder string + + asServer bool ) func init() { @@ -18,6 +20,8 @@ flag.StringVar(&ipcURL, "ipc", "ipc:///tmp/pic.ipc", "ipc label") flag.StringVar(&proc, "proc", "", "proc name") + + flag.BoolVar(&asServer, "server", false, "run ipc as server") } const ( @@ -32,7 +36,12 @@ imageChan := make(chan srv.ImageInfo) d := srv.NewReciever(ipcURL, imageChan) - go d.RunAsServer() + + if asServer { + go d.RunAsServer() + } else { + go d.RunAsClient() + } demo.ShowYolo(imageChan) -- Gitblit v1.8.0