Add example for sending multipart messages

This commit is contained in:
Alexey Rybalchenko
2015-11-06 13:20:11 +01:00
parent 2e789e4439
commit 307d698736
18 changed files with 545 additions and 12 deletions

View File

@@ -40,7 +40,7 @@ void FairMQExample3Processor::Run()
// Receive the message (blocks until received or interrupted (e.g. by state change)).
// Returns size of the received message or -1 if interrupted.
if (fChannels.at("data-in").at(0).Receive(input) > 0)
if (fChannels.at("data-in").at(0).Receive(input) >= 0)
{
LOG(INFO) << "Received data, processing...";

View File

@@ -30,7 +30,7 @@ void FairMQExample3Sink::Run()
{
unique_ptr<FairMQMessage> msg(fTransportFactory->CreateMessage());
if (fChannels.at("data-in").at(0).Receive(msg) > 0)
if (fChannels.at("data-in").at(0).Receive(msg) >= 0)
{
LOG(INFO) << "Received message: \""
<< string(static_cast<char*>(msg->GetData()), msg->GetSize())