From d9da6cb3e69c630f8c2cccfc4703b29c3498269e Mon Sep 17 00:00:00 2001
From: chenshijun <chenshijun@aiotlink.com>
Date: 星期二, 19 三月 2019 18:06:50 +0800
Subject: [PATCH] 增加erl节点的端口配置
---
QiaoJiaSystem/FaceDetectServer/main_detect.cpp | 18 +++++++++++-------
1 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/QiaoJiaSystem/FaceDetectServer/main_detect.cpp b/QiaoJiaSystem/FaceDetectServer/main_detect.cpp
index e086792..bf9f733 100644
--- a/QiaoJiaSystem/FaceDetectServer/main_detect.cpp
+++ b/QiaoJiaSystem/FaceDetectServer/main_detect.cpp
@@ -31,8 +31,8 @@
int threadMax = atol(ich->getProperties()->getProperty("user.thread.max").c_str());
#endif
ich->getProperties()->setProperty("Ice.ThreadPool.Server.SizeMax", std::to_string(threadMax));
- appPref.setLongData("gpu.index", atol(gpuIndex.c_str()));
- appPref.setLongData("thread.max", threadMax);
+ appPref.setIntData("gpu.index", atol(gpuIndex.c_str()));
+ appPref.setIntData("thread.max", threadMax);
auto adapter = ich->createObjectAdapter(adapterName);
adapter->add(new FaceDetectServerI(), Ice::stringToIdentity(identity));
@@ -47,13 +47,17 @@
ENABLEGLOG(GET_STR_CONFIG("logPath").c_str());
auto ich = Ice::initialize(argc, argv);
- appPref.setLongData("gpu.index", 1);
- appPref.setLongData("thread.max", 32);
+ if (argc < 4) {
+ assert("t_value.size()");
+ }
+ appPref.setIntData("gpu.index", atoi(argv[1]));
+ appPref.setIntData("RpcFDPort", atoi(argv[2]));
+ appPref.setIntData("thread.max", atoi(argv[3]));//绾跨▼姹犲ぇ灏�
- IceRpcServer<FaceDetectServerI> server("faceServer", 10002, "tcp");
+ IceRpcServer<FaceDetectServerI> server("faceServer", appPref.getIntData("RpcFDPort"), "tcp");
server.setMessageSizeMax(1024 * 1024 * 50);
- server.setPoolInitSize(10);
- server.setPoolMaxSize(32);
+ server.setPoolInitSize(appPref.getIntData("thread.max"));
+ server.setPoolMaxSize(appPref.getIntData("thread.max"));
server.runWaitShutDown();
return 0;
}
--
Gitblit v1.8.0