FairMQ/fairmq/FairMQProxy.cxx
Alexey Rybalchenko d14d96ea70 fix CID 10112
fix CIDs 10922, 10921

fix CIDs 10369, 10371, 10372, 10373, 10374

fix CID 10406

fix CID 10414

fix CIDs 10850-52, 10857, 10859-60, 10863, 10869-76

fix CIDs 10014 10080
2014-07-04 13:24:44 +02:00

54 lines
1.3 KiB
C++

/********************************************************************************
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence version 3 (LGPL) version 3, *
* copied verbatim in the file "LICENSE" *
********************************************************************************/
/**
* FairMQProxy.cxx
*
* @since 2013-10-02
* @author A. Rybalchenko
*/
#include <boost/thread.hpp>
#include <boost/bind.hpp>
#include "FairMQLogger.h"
#include "FairMQProxy.h"
FairMQProxy::FairMQProxy()
{
}
FairMQProxy::~FairMQProxy()
{
}
void FairMQProxy::Run()
{
LOG(INFO) << ">>>>>>> Run <<<<<<<";
boost::thread rateLogger(boost::bind(&FairMQDevice::LogSocketRates, this));
FairMQMessage* msg = fTransportFactory->CreateMessage();
size_t bytes_received = 0;
while (fState == RUNNING)
{
bytes_received = fPayloadInputs->at(0)->Receive(msg);
if (bytes_received)
{
fPayloadOutputs->at(0)->Send(msg);
bytes_received = 0;
}
}
delete msg;
rateLogger.interrupt();
rateLogger.join();
}