|
@@ -45,6 +45,7 @@ void carmakerwork::threadwork()
|
|
std::shared_ptr<char> pout_ptr = nullptr;
|
|
std::shared_ptr<char> pout_ptr = nullptr;
|
|
int64_t nWorkID;
|
|
int64_t nWorkID;
|
|
int nOutSize;
|
|
int nOutSize;
|
|
|
|
+ int nnowork = 0;
|
|
|
|
|
|
while(mbRun)
|
|
while(mbRun)
|
|
{
|
|
{
|
|
@@ -89,15 +90,23 @@ void carmakerwork::threadwork()
|
|
|
|
|
|
if(reply.mnres() == 1)
|
|
if(reply.mnres() == 1)
|
|
{
|
|
{
|
|
|
|
+ nnowork = 0;
|
|
nWorkID = reply.workid();
|
|
nWorkID = reply.workid();
|
|
std::shared_ptr<char> pinput_ptr = nullptr;
|
|
std::shared_ptr<char> pinput_ptr = nullptr;
|
|
int ninputsize = static_cast<int>(reply.data_input().size()) ;
|
|
int ninputsize = static_cast<int>(reply.data_input().size()) ;
|
|
|
|
+ pinput_ptr = std::shared_ptr<char>(new char[ninputsize]);
|
|
|
|
+ memcpy(pinput_ptr.get(),reply.data_input().data(),ninputsize);
|
|
nRes = ExecCarmakerWork(nWorkID,reply.strinputname(),reply.stroutputname(),reply.strcmd(),
|
|
nRes = ExecCarmakerWork(nWorkID,reply.strinputname(),reply.stroutputname(),reply.strcmd(),
|
|
pinput_ptr,ninputsize,pout_ptr,nOutSize);
|
|
pinput_ptr,ninputsize,pout_ptr,nOutSize);
|
|
}
|
|
}
|
|
if(reply.mnres() == 0)
|
|
if(reply.mnres() == 0)
|
|
{
|
|
{
|
|
- std::cout<<" no work."<<std::endl;
|
|
|
|
|
|
+ nnowork++;
|
|
|
|
+ if(nnowork>=30)
|
|
|
|
+ {
|
|
|
|
+ nnowork = 0;
|
|
|
|
+ std::cout<<" no work."<<std::endl;
|
|
|
|
+ }
|
|
nRes = 0;
|
|
nRes = 0;
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
@@ -105,6 +114,8 @@ void carmakerwork::threadwork()
|
|
<< std::endl;
|
|
<< std::endl;
|
|
std::cout<<"RPC failed"<<std::endl;
|
|
std::cout<<"RPC failed"<<std::endl;
|
|
|
|
|
|
|
|
+ std::this_thread::sleep_for(std::chrono::milliseconds(3000));
|
|
|
|
+
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|