9#include "daq/dataflow/EvtSocket.h"
15EvtSocketSend::EvtSocketSend(std::string host,
int port)
17 m_sock =
new SocketSend(host.c_str(), (u_short)port);
18 m_recbuf =
new char[MAXEVTSIZE];
21EvtSocketSend::~EvtSocketSend()
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 EvtSocketSend::send_buffer(
int nbytes,
char* buf)
44 return m_sock->put(buf, nbytes);
47int EvtSocketSend::recv_buffer(
char* buf)
49 int stat = m_sock->get(buf, MAXEVTSIZE);
53int EvtSocketSend::recv_pxd_buffer(
char* buf)
55 int stat = m_sock->get_pxd(buf, MAXEVTSIZE);
67EvtSocketRecv::EvtSocketRecv(
int port,
bool accept_at_init)
70 m_recbuf =
new char[MAXEVTSIZE];
75EvtSocketRecv::~EvtSocketRecv()
83 int stat = m_sock->get(m_recbuf, MAXEVTSIZE);
84 if (stat <= 0)
return NULL;
92 return m_sock->put((
char*)msg->
buffer(), msg->
size());
95int EvtSocketRecv::send_buffer(
int nbytes,
char* buf)
97 return m_sock->put(buf, nbytes);
100int EvtSocketRecv::recv_buffer(
char* buf)
102 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.