Once an experiment terminates, all results will be sent to the server.
One an experiment terminates, sending the results back to the server will be initiated by the jobclients destructor. git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@2042 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
@ -19,6 +19,12 @@ JobClient::JobClient(const std::string& server, int port)
|
||||
m_job_throughput = 1; // client gets only one job at the first request
|
||||
}
|
||||
|
||||
JobClient::~JobClient()
|
||||
{
|
||||
// Send back completed jobs to the server
|
||||
sendResultsToServer();
|
||||
}
|
||||
|
||||
bool JobClient::connectToServer()
|
||||
{
|
||||
// Connect to server
|
||||
@ -190,6 +196,13 @@ bool JobClient::sendResult(ExperimentData& result)
|
||||
//Reset timer for new time measurement
|
||||
m_job_runtime.reset();
|
||||
|
||||
return sendResultsToServer();
|
||||
}
|
||||
}
|
||||
|
||||
bool JobClient::sendResultsToServer()
|
||||
{
|
||||
if (m_results.size() != 0) {
|
||||
if (!connectToServer()) {
|
||||
return false;
|
||||
}
|
||||
@ -225,6 +238,7 @@ bool JobClient::sendResult(ExperimentData& result)
|
||||
close(m_sockfd);
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} // end-of-namespace: fail
|
||||
|
||||
Reference in New Issue
Block a user