mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-16 18:11:49 +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
@@ -15,6 +15,7 @@
|
||||
#include <zmq.h>
|
||||
|
||||
#include "FairMQPollerZMQ.h"
|
||||
#include "FairMQLogger.h"
|
||||
|
||||
FairMQPollerZMQ::FairMQPollerZMQ(const vector<FairMQSocket*>& inputs)
|
||||
{
|
||||
@@ -32,7 +33,11 @@ FairMQPollerZMQ::FairMQPollerZMQ(const vector<FairMQSocket*>& inputs)
|
||||
|
||||
void FairMQPollerZMQ::Poll(int timeout)
|
||||
{
|
||||
zmq_poll(items, fNumItems, timeout);
|
||||
int rc = zmq_poll(items, fNumItems, timeout);
|
||||
if (rc < 0)
|
||||
{
|
||||
LOG(ERROR) << "polling failed, reason: " << zmq_strerror(errno);
|
||||
}
|
||||
}
|
||||
|
||||
bool FairMQPollerZMQ::CheckInput(int index)
|
||||
@@ -43,6 +48,14 @@ bool FairMQPollerZMQ::CheckInput(int index)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool FairMQPollerZMQ::CheckOutput(int index)
|
||||
{
|
||||
if (items[index].revents & ZMQ_POLLOUT)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
FairMQPollerZMQ::~FairMQPollerZMQ()
|
||||
{
|
||||
if (items != NULL)
|
||||
|
Reference in New Issue
Block a user