From e15c4888f720b8781260b901ac82d058f8f7c3b5 Mon Sep 17 00:00:00 2001 From: chenshijun <csj_sky@126.com> Date: 星期三, 27 三月 2019 14:34:37 +0800 Subject: [PATCH] 移植nsq到项目中,将最短最长时长的参数修改成nsq配置 --- QiaoJiaSystem/YoloServer/main.cpp | 29 ++++++++++++++++++++--------- 1 files changed, 20 insertions(+), 9 deletions(-) diff --git a/QiaoJiaSystem/YoloServer/main.cpp b/QiaoJiaSystem/YoloServer/main.cpp index 20f2a6c..ff7aac0 100644 --- a/QiaoJiaSystem/YoloServer/main.cpp +++ b/QiaoJiaSystem/YoloServer/main.cpp @@ -7,6 +7,7 @@ #include <basic/util/app/AppConfig.h> int main(int argc, char **argv) { + std::cout<<__DATE__<<" "<<__TIME__<<std::endl; SAVE_APP_ARGS; ENABLEGLOG(GET_STR_CONFIG("logPath").c_str()); auto ich = Ice::initialize(argc, argv); @@ -29,18 +30,28 @@ // return -1; // } - int gpuindex = 0; - int poolNum = 1; - int portNum = 10003; +// int gpuindex = 0; +// int poolNum = 1; +// int portNum = 10003; +// +// appPref.setIntData("gpu.index", gpuindex); +// appPref.setFloatData("thresh.detect", 0.85); +// appPref.setIntData("poolNum", poolNum); - appPref.setIntData("gpu.index", gpuindex); - appPref.setFloatData("thresh.detect", 0.7); - appPref.setIntData("poolNum", poolNum); + if (argc < 4) { + assert("t_value.size()"); + } + appPref.setIntData("gpu.index", atoi(argv[1])); + appPref.setIntData("RpcYOLOPort", atoi(argv[2])); + appPref.setFloatData("thresh.detect", atof(argv[3])); - IceRpcServer<YoloDetectServerI> server("yoloServer", portNum, "tcp"); +// appPref.setIntData("poolNum", 1);//YOlO涓嶈兘澶氱嚎绋嬶紝瀹规槗宕╂簝 + + + IceRpcServer<YoloDetectServerI> server("yoloServer", appPref.getIntData("RpcYOLOPort"), "tcp"); server.setMessageSizeMax(1024 * 1024 * 50); - server.setPoolInitSize(1); - server.setPoolMaxSize(1); + server.setPoolInitSize(1);//YOlO涓嶈兘澶氱嚎绋嬶紝瀹规槗宕╂簝 + server.setPoolMaxSize(1);//YOlO涓嶈兘澶氱嚎绋嬶紝瀹规槗宕╂簝 server.runWaitShutDown(); return 0; } -- Gitblit v1.8.0