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:
parent
7226fd7310
commit
af9c648e7a
2 changed files with 7 additions and 2 deletions
|
@ -30,6 +30,8 @@ class Dumper {
|
|||
protected:
|
||||
int socketFd;
|
||||
std::string socketName;
|
||||
bool supressRepeatedWarning;
|
||||
uint64_t warningCounter;
|
||||
|
||||
public:
|
||||
Dumper(std::string socketNameIn);
|
||||
|
|
|
@ -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++;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue