mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 17:41:45 +00:00
Check return values of Receive calls in the examples
This commit is contained in:
committed by
Mohammad Al-Turany
parent
6dc4dc84b3
commit
4be6ba6e66
@@ -30,9 +30,10 @@ void FairMQExample4Sink::Run()
|
||||
{
|
||||
std::unique_ptr<FairMQMessage> msg(fTransportFactory->CreateMessage());
|
||||
|
||||
fChannels.at("data-in").at(0).Receive(msg);
|
||||
|
||||
LOG(INFO) << "Received message: \"" << *(static_cast<int*>(msg->GetData())) << "\"";
|
||||
if (fChannels.at("data-in").at(0).Receive(msg) >= 0)
|
||||
{
|
||||
LOG(INFO) << "Received message: \"" << *(static_cast<int*>(msg->GetData())) << "\"";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user