Belle II Software development
EvtSocketSend Class Reference

Public Member Functions

 EvtSocketSend (std::string hostname, int port)
 
int status ()
 
int send (EvtMessage *msg)
 
EvtMessagerecv (void)
 
int send_buffer (int size, char *buf)
 
int recv_buffer (char *buf)
 
int recv_pxd_buffer (char *buf)
 
SocketSendsock (void)
 

Private Attributes

SocketSendm_sock
 
char * m_recbuf
 

Detailed Description

Definition at line 26 of file EvtSocket.h.

Constructor & Destructor Documentation

◆ EvtSocketSend()

EvtSocketSend ( std::string  hostname,
int  port 
)

Definition at line 15 of file EvtSocket.cc.

16{
17 m_sock = new SocketSend(host.c_str(), (u_short)port);
18 m_recbuf = new char[MAXEVTSIZE];
19}

◆ ~EvtSocketSend()

Definition at line 21 of file EvtSocket.cc.

22{
23 delete m_sock;
24 delete[] m_recbuf;
25}

Member Function Documentation

◆ recv()

EvtMessage * recv ( void  )

Definition at line 33 of file EvtSocket.cc.

34{
35 int stat = m_sock->get(m_recbuf, MAXEVTSIZE);
36 if (stat <= 0) return NULL;
37 EvtMessage* evt = new EvtMessage(m_recbuf);
38 // delete [] evtbuf;
39 return evt;
40}
Class to manage streamed object.
Definition: EvtMessage.h:59

◆ recv_buffer()

int recv_buffer ( char *  buf)

Definition at line 47 of file EvtSocket.cc.

48{
49 int stat = m_sock->get(buf, MAXEVTSIZE);
50 return stat;
51}

◆ recv_pxd_buffer()

int recv_pxd_buffer ( char *  buf)

Definition at line 53 of file EvtSocket.cc.

54{
55 int stat = m_sock->get_pxd(buf, MAXEVTSIZE);
56 return stat;
57}

◆ send()

int send ( EvtMessage msg)

Definition at line 27 of file EvtSocket.cc.

28{
29 // printf ( "EvtSocketSend : sending = %d\n", msg->size() );
30 return m_sock->put((char*)msg->buffer(), msg->size());
31}
char * buffer()
Get buffer address.
Definition: EvtMessage.cc:76
int size() const
Get size of message including headers.
Definition: EvtMessage.cc:94

◆ send_buffer()

int send_buffer ( int  size,
char *  buf 
)

Definition at line 42 of file EvtSocket.cc.

43{
44 return m_sock->put(buf, nbytes);
45}

◆ sock()

SocketSend * sock ( void  )

Definition at line 59 of file EvtSocket.cc.

60{
61 return m_sock;
62}

Member Data Documentation

◆ m_recbuf

char* m_recbuf
private

Definition at line 44 of file EvtSocket.h.

◆ m_sock

SocketSend* m_sock
private

Definition at line 43 of file EvtSocket.h.


The documentation for this class was generated from the following files: