mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 09:31:45 +00:00
- 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:
committed by
Mohammad Al-Turany
parent
8cd120aef4
commit
0a610926a1
@@ -35,7 +35,7 @@ void FairMQMerger::Run()
|
||||
|
||||
FairMQPoller* poller = fTransportFactory->CreatePoller(*fPayloadInputs);
|
||||
|
||||
bool received = false;
|
||||
int received = 0;
|
||||
|
||||
while (fState == RUNNING)
|
||||
{
|
||||
@@ -49,10 +49,10 @@ void FairMQMerger::Run()
|
||||
{
|
||||
received = fPayloadInputs->at(i)->Receive(msg);
|
||||
}
|
||||
if (received)
|
||||
if (received > 0)
|
||||
{
|
||||
fPayloadOutputs->at(0)->Send(msg);
|
||||
received = false;
|
||||
received = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,4 +67,6 @@ void FairMQMerger::Run()
|
||||
} catch(boost::thread_resource_error& e) {
|
||||
LOG(ERROR) << e.what();
|
||||
}
|
||||
|
||||
FairMQDevice::Shutdown();
|
||||
}
|
||||
|
Reference in New Issue
Block a user