- Proper process termination:

if interrupted with CTRL+C blocking socket calls will return with -1. Each device should call FairMQDevice::Shutdown() before ending the running state to close open sockets, otherwise the interrupt call itself will block.

- FIX: Update number of received messages for FairMQFileSink.
- Add ability to poll on outputs for FairMQPoller.
This commit is contained in:
Alexey Rybalchenko
2014-08-12 09:11:51 +02:00
committed by Mohammad Al-Turany
parent 8cd120aef4
commit 0a610926a1
23 changed files with 236 additions and 208 deletions

View File

@@ -32,7 +32,7 @@ void FairMQSplitter::Run()
boost::thread rateLogger(boost::bind(&FairMQDevice::LogSocketRates, this));
bool received = false;
int received = 0;
int direction = 0;
while (fState == RUNNING)
@@ -41,7 +41,7 @@ void FairMQSplitter::Run()
received = fPayloadInputs->at(0)->Receive(msg);
if (received)
if (received > 0)
{
fPayloadOutputs->at(direction)->Send(msg);
direction++;
@@ -49,7 +49,7 @@ void FairMQSplitter::Run()
{
direction = 0;
}
received = false;
received = 0;
}
delete msg;
@@ -61,4 +61,6 @@ void FairMQSplitter::Run()
} catch(boost::thread_resource_error& e) {
LOG(ERROR) << e.what();
}
FairMQDevice::Shutdown();
}