派生自 development/c++

xuxiuxi
2019-03-04 17675f1c6447b6e014b520608ce6d5f1f2e9707a
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
41
42
43
44
45
46
47
48
49
50
51
52
53
#include <stdio.h>
#include <iostream>
#include <unistd.h>
#include <cstring>
#include "RtspAnalysManager.h"
#include <basic/debug/Debug.h>
#include <thread>
#include <Ice/Ice.h>
#include <basic/rpc/IceRpc.hpp>
//"192.168.1.4", 8000, "admin", "basic123"
 
using namespace std;
 
#include <basic/util/file/FileUtil.h>
#include <basic/util/app/AppPreference.hpp>
#include <basic/util/app/AppConfig.h>
#include <basic/util/app/AppConfig.h>
 
static void startManager(LDBTool *_dbTool) {
    RtspAnalysManager rtspAnalysManager(_dbTool);
    while (1) {
        sleep(1 * 60 * 60 * 12);
    }
}
 
 
int main(int argc, char **argv) {
    std::cout << __DATE__ << " " << __TIME__ << std::endl;
    SAVE_APP_ARGS
 
#ifdef GLOG
    ENABLEGLOG(GET_STR_CONFIG("logPath").c_str());
#endif
 
    int gindx = atoi(argv[1]) % 2;
    DBG(gindx);
    appPref.setLongData("gpu.index", gindx);
    appPref.setIntData("show.image", 0);
 
    //todo
    appPref.setIntData("CamStart", atoi(argv[1]));
    appPref.setIntData("CamStep", atoi(argv[2]));
    appPref.setIntData("RpcServerPort", atoi(argv[3]));
 
    appPref.setStringData("user.loop.absolute.path", appConfig.getStringProperty("cutPath"));
    IceRpcServer<RtspAnalysManager> server("RtspAnalysServer", appPref.getIntData("RpcServerPort"), "tcp");
    server.setMessageSizeMax(1024 * 1024 * 50);
    server.setPoolInitSize(1);
    server.setPoolMaxSize(1);
    server.runWaitShutDown();
    return 0;
 
}