9#include "daq/expreco/EventSampler.h"
18EventSampler::EventSampler(vector<string> nodes,
int port,
string rbufname,
int interval) : m_interval(interval)
25 string& nodename = *it;
26 printf(
"EventSampler : connecting to %s (port %d)\n", nodename.c_str(), port);
29 printf(
"EventSampler : error to connect to %s\n",
32 m_socklist.push_back(sock);
36 printf(
"EventSampler : init : socklist = %lu\n", m_socklist.size());
40EventSampler::~EventSampler()
42 for (vector<EvtSocketSend*>::iterator it = m_socklist.begin();
43 it != m_socklist.end(); ++it) {
44 EvtSocketSend* sock = *it;
51int EventSampler::server()
57 for (vector<EvtSocketSend*>::iterator it = m_socklist.begin();
58 it != m_socklist.end(); ++it) {
60 EvtSocketSend* sock = *it;
63 EvtMessage* msg = sock->recv();
67 printf(
"EventSampler : Error to receive data\n");
74 if (nsample % 1000 == 0)
75 printf(
"EventSampler : %d events sampled and queued\n", nsample);
int paddedSize() const
Same as size(), but as size of an integer array.
char * buffer()
Get buffer address.
Class to manage a Ring Buffer placed in an IPC shared memory.
Abstract base class for different kinds of events.