Check return values of Receive calls in the examples

This commit is contained in:
Alexey Rybalchenko
2015-11-03 13:15:13 +01:00
committed by Mohammad Al-Turany
parent 6dc4dc84b3
commit 4be6ba6e66
3 changed files with 21 additions and 16 deletions

View File

@@ -49,10 +49,11 @@ void FairMQExample5Client::Run()
if (fChannels.at("data").at(0).Send(request) > 0)
{
fChannels.at("data").at(0).Receive(reply);
LOG(INFO) << "Received reply from server: \"" << string(static_cast<char*>(reply->GetData()), reply->GetSize()) << "\"";
if (fChannels.at("data").at(0).Receive(reply) >= 0)
{
LOG(INFO) << "Received reply from server: \"" << string(static_cast<char*>(reply->GetData()), reply->GetSize()) << "\"";
}
}
}
}