派生自 development/c++

pansen
2019-03-14 c965e2238cef9bbc761096ea2c8bf9a8b874d835
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//
// 人脸对比主进程入口
// Created by pans on 4/27/18.
//
#include <iostream>
#include <Ice/Ice.h>
#include <thread>
 
#include <basic/rpc/IceRpc.hpp>
#include <basic/util/app/AppPreference.hpp>
#include "FaceFeatureSearchServerI.h"
#include <basic/util/app/AppConfig.h>
#include <basic/debug/Debug.h>
 
using namespace std;
 
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);
 
    DBG("\n\n\nstart\n\n");
 
    appPref.setLongData("thread.max", 16);
    //#todo
 
//    appPref.setStringData("ipAdd", "192.168.1.185");
//    appPref.setIntData("ipPort", 9200);
 
    //设置es上传ip和端口
    appPref.setStringData("ipAdd", appConfig.getStringProperty("ES_IP"));
    appPref.setIntData("ipPort", appConfig.getIntProperty("ES_PORT"));
 
    IceRpcServer<FaceFeatureSearchServerI> server("faceCmServer", 10004, "tcp");
    server.setMessageSizeMax(1024 * 1024 * 50);
    server.setPoolInitSize(10);
    server.setPoolMaxSize(32);
    server.runWaitShutDown();
}