#include #include #include "grpcclient.h" #include "ivversion.h" #include "ivexit.h" #include "ivbacktrace.h" static QCoreApplication * gApp; static grpcclient * gpgrpcclient; void ExitFunc() { // gApp->quit(); delete gpgrpcclient; std::cout<<"driver_cloud_grpc_thread exit."<quit(); } void signal_handler(int sig) { if(sig == SIGINT) { ExitFunc(); } } int main(int argc, char *argv[]) { showversion("driver_cloud_grpc_client"); RegisterIVBackTrace(); QCoreApplication a(argc, argv); gApp = &a; // std::thread * ptest = new std::thread(test); // return a.exec(); char stryamlpath[256]; if(argc<2) { snprintf(stryamlpath,255,"driver_cloud_grpc_thread.yaml"); // strncpy(stryamlpath,abs_ymlpath,255); } else { strncpy(stryamlpath,argv[1],255); } // dec_yaml(stryamlpath); grpcclient * pgrpcclient = new grpcclient(stryamlpath); pgrpcclient->start(); gpgrpcclient = pgrpcclient; signal(SIGINT,signal_handler); iv::ivexit::RegIVExitCall(ExitFunc); return a.exec(); }