diff --git a/include/villas/dumper.hpp b/include/villas/dumper.hpp index b09814fbe..0c5b65a93 100644 --- a/include/villas/dumper.hpp +++ b/include/villas/dumper.hpp @@ -30,6 +30,8 @@ class Dumper { protected: int socketFd; std::string socketName; + bool supressRepeatedWarning; + uint64_t warningCounter; public: Dumper(std::string socketNameIn); diff --git a/lib/dumper.cpp b/lib/dumper.cpp index 95340ae10..49f428af1 100644 --- a/lib/dumper.cpp +++ b/lib/dumper.cpp @@ -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++; } } } \ No newline at end of file