9#include "daq/expreco/EventServer.h"
10#include <framework/pcore/MsgHandler.h>
17EventServer::EventServer(
string rbufname,
int port) : m_port(port)
27EventServer::~EventServer()
34int EventServer::server()
38 char* evtbuffer =
new char[MAXEVTSIZE];
41 int loop_counter [[maybe_unused]] = 0;
42 while (m_force_exit == 0) {
44 int size = m_rbuf->
remq((
int*)evtbuffer);
49 int exam_stat = m_man->examine();
52 printf(
"Initial connection request detected!\n");
54 }
else if (exam_stat == 1 && size > 0) {
56 vector<int>& recvsock = m_man->connected_socket_list();
58 for (vector<int>::iterator it = recvsock.begin();
59 it != recvsock.end(); ++it) {
61 if (m_man->connected(fd,
true)) {
62 int is = sio.put(fd, evtbuffer, size * 4);
65 printf(
"EventServer: fd %d disconnected\n", fd);
A class to encode/decode an EvtMessage.
Class to manage a Ring Buffer placed in an IPC shared memory.
int remq(int *buf)
Pick up a buffer from the RingBuffer.
Abstract base class for different kinds of events.