派生自 development/c++

pansen
2019-01-10 0436e5443295395025f89f0d091aab1e9551d1a4
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
#include <Ice/Ice.h>
#include <basic/rpc/IceRpc.hpp>
#include <basic/util/app/AppPreference.hpp>
#include "YoloDetectServerI.h"
#include <basic/debug/Debug.h>
 
#include <basic/util/app/AppConfig.h>
 
int main(int argc, char **argv) {
    SAVE_APP_ARGS;
    ENABLEGLOG(GET_STR_CONFIG("logPath").c_str());
    auto ich = Ice::initialize(argc, argv);
 
//    std::string identity =ich->getProperties()->getProperty("user.yolo.identity");
//    std::string gpuIndex =ich->getProperties()->getProperty("user.gpu.index");
//    std::string adapterName = ich->getProperties()->getProperty("user.adapter.name");
//    float fthresh = atof(ich->getProperties()->getProperty("user.thresh.detect").c_str());
 
//    appPref.setIntData("gpu.index",atol(gpuIndex.c_str()));
//    appPref.setFloatData("thresh.detect",fthresh);
 
//    auto adapter =  ich->createObjectAdapter(adapterName);
//    adapter->add(new YoloDetectServerI(), Ice::stringToIdentity(identity));
//    adapter->activate();
//    ich->waitForShutdown();
    appPref.setIntData("gpu.index", 0);
    appPref.setFloatData("thresh.detect", 0.7);
 
    IceRpcServer<YoloDetectServerI> server("yoloServer", 10003, "tcp");
    server.setMessageSizeMax(1024 * 1024 * 50);
    server.setPoolInitSize(5);
    server.setPoolMaxSize(5);
    server.runWaitShutDown();
    return 0;
}