1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

add supress warnings for dumper

This commit is contained in:
Manuel Pitz 2020-10-19 20:04:03 +02:00
parent 7226fd7310
commit af9c648e7a
2 changed files with 7 additions and 2 deletions

View file

@ -30,6 +30,8 @@ class Dumper {
protected:
int socketFd;
std::string socketName;
bool supressRepeatedWarning;
uint64_t warningCounter;
public:
Dumper(std::string socketNameIn);

View file

@ -35,7 +35,9 @@ using namespace villas::node;
Dumper::Dumper(std::string socketNameIn) :
socketName("")
socketName(""),
supressRepeatedWarning(true),
warningCounter(0)
{
openSocket(socketNameIn);
}
@ -82,8 +84,9 @@ void Dumper::writeData(uint len, double* yData, double* xData) {
str += "\n";
bytesWritten = write(socketFd, str.c_str(), str.length());
if( (long unsigned int) bytesWritten != str.length() ) {
if( (long unsigned int) bytesWritten != str.length() && (!supressRepeatedWarning || warningCounter<1) ) {
warning("Could not send all content to socket %s", socketName.c_str());
warningCounter++;
}
}
}