9#include "daq/dataflow/REvtSocket.h"
15REvtSocketRecv::REvtSocketRecv(std::string host,
int port)
17 m_sock =
new RSocketRecv(host.c_str(), (u_short)port);
18 m_recbuf =
new char[MAXEVTSIZE];
21REvtSocketRecv::~REvtSocketRecv()
30 return m_sock->put((
char*)msg->
buffer(), msg->
size());
35 int stat = m_sock->get(m_recbuf, MAXEVTSIZE);
36 if (stat <= 0)
return NULL;
42int REvtSocketRecv::send_buffer(
int nbytes,
char* buf)
44 return m_sock->put(buf, nbytes);
47int REvtSocketRecv::recv_buffer(
char* buf)
49 int stat = m_sock->get(buf, MAXEVTSIZE);
60REvtSocketSend::REvtSocketSend(
int port,
bool accept_at_init)
63 m_recbuf =
new char[MAXEVTSIZE];
68REvtSocketSend::~REvtSocketSend()
74EvtMessage* REvtSocketSend::REvtSocketSend::recv()
76 int stat = m_sock->get(m_recbuf, MAXEVTSIZE);
77 if (stat <= 0)
return NULL;
85 return m_sock->put((
char*)msg->
buffer(), msg->
size());
88int REvtSocketSend::send_buffer(
int nbytes,
char* buf)
90 return m_sock->put(buf, nbytes);
93int REvtSocketSend::recv_buffer(
char* buf)
95 int stat = m_sock->get(buf, MAXEVTSIZE);
Class to manage streamed object.
char * buffer()
Get buffer address.
int size() const
Get size of message including headers.
Abstract base class for different kinds of events.