9 #include "daq/dataflow/REvtSocket.h"
15 REvtSocketRecv::REvtSocketRecv(std::string host,
int port)
17 m_sock =
new RSocketRecv(host.c_str(), (u_short)port);
18 m_recbuf =
new char[MAXEVTSIZE];
21 REvtSocketRecv::~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;
42 int REvtSocketRecv::send_buffer(
int nbytes,
char* buf)
44 return m_sock->put(buf, nbytes);
47 int REvtSocketRecv::recv_buffer(
char* buf)
49 int stat = m_sock->get(buf, MAXEVTSIZE);
60 REvtSocketSend::REvtSocketSend(
int port,
bool accept_at_init)
63 m_recbuf =
new char[MAXEVTSIZE];
68 REvtSocketSend::~REvtSocketSend()
74 EvtMessage* 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());
88 int REvtSocketSend::send_buffer(
int nbytes,
char* buf)
90 return m_sock->put(buf, nbytes);
93 int 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.