9#include "daq/expreco/EventSampler.h"
18EventSampler::EventSampler(vector<string> nodes,
int port,
string rbufname,
int interval) : m_interval(interval)
24 for (vector<string>::iterator it = nodes.begin(); it != nodes.end(); ++it) {
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) {
51int EventSampler::server()
57 for (vector<EvtSocketSend*>::iterator it = m_socklist.begin();
58 it != m_socklist.end(); ++it) {
67 printf(
"EventSampler : Error to receive data\n");
74 if (nsample % 1000 == 0)
75 printf(
"EventSampler : %d events sampled and queued\n", nsample);
Class to manage streamed object.
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.
int insq(const int *buf, int size, bool checkTx=false)
Append a buffer to the RingBuffer.
Abstract base class for different kinds of events.