| | |
| | | |
| | | |
| | | int WORKERS ; |
| | | std::string localUrl; |
| | | std::string remoteUrl; |
| | | |
| | | PropertiesConfig config("../data/config.txt"); |
| | |
| | | } |
| | | |
| | | |
| | | Json::Value response; |
| | | Json::Value payload; |
| | | response["code"] = rv; |
| | | response["msg"] = rmsg; |
| | | // Json::Value response; |
| | | // Json::Value payload; |
| | | // response["code"] = rv; |
| | | // response["msg"] = rmsg; |
| | | |
| | | // Json::Value filelist; |
| | | // for(std::string f : files) { |
| | | // filelist.append(f); |
| | | // } |
| | | // payload["filelist"] = filelist; |
| | | // response["payload"] = payload; |
| | | |
| | | Json::Value request; |
| | | request["method"] = "downloadByTimeCallBack"; |
| | | Json::Value arguments; |
| | | Json::Value filelist; |
| | | for(std::string f : files) { |
| | | filelist.append(f); |
| | | } |
| | | payload["filelist"] = filelist; |
| | | response["payload"] = payload; |
| | | std::string str = response.toStyledString(); |
| | | arguments["fileList"] = filelist; |
| | | arguments["loginUUID"] = drequest.loginUUID; |
| | | |
| | | request["arguments"] = arguments; |
| | | std::string str = request.toStyledString(); |
| | | |
| | | std::cout << "download finished, call back" << std::endl; |
| | | std::cout << str << std::endl; |
| | |
| | | { |
| | | Netdisk_DownloadRequest request; |
| | | task_queue.pop(request); |
| | | err_msg(0, "====take a task"); |
| | | work(request); |
| | | } |
| | | } |
| | |
| | | { |
| | | //环境变量初始化 |
| | | WORKERS = config.getInt("workers"); |
| | | localUrl = config.get("local_url"); |
| | | remoteUrl = config.get("remote_url"); |
| | | remoteUrl = config.get("client_url"); |
| | | |
| | | //海康设备环境初始化 |
| | | Netdisk_EnvConfig hcEnvConfig; |
| | | hcEnvConfig.libpath = config.get("hclib"); |
| | | hcEnvConfig.libpath = "../lib/hc"; |
| | | HCNetdisk::netdisk_init(&hcEnvConfig); |
| | | |
| | | |
| | |
| | | |
| | | initThreadPool(); |
| | | |
| | | startServer(localUrl.c_str()); |
| | | startServer(config.get("server_url").c_str()); |
| | | |
| | | |
| | | HCNetdisk::netdisk_deinit(); |