|
| Rb2Sock (std::string rbuf, std::string dest, int port) |
| Constuctor and Destructor.
|
|
int | SendEvent (void) |
| Event function.
|
|
Definition at line 23 of file Rb2Sock.h.
◆ Rb2Sock()
Rb2Sock |
( |
std::string | rbuf, |
|
|
std::string | dest, |
|
|
int | port ) |
Constuctor and Destructor.
Definition at line 16 of file Rb2Sock.cc.
17{
18
19 m_rbuf = new RingBuffer(rbuf.c_str());
20 m_sock = new EvtSocketSend(dest, port);
21 m_evtbuf = new char[MAXEVTSIZE];
22
23}
◆ ~Rb2Sock()
Definition at line 25 of file Rb2Sock.cc.
26{
27 delete m_sock;
28 delete m_rbuf;
29}
◆ SendEvent()
Event function.
Definition at line 31 of file Rb2Sock.cc.
32{
33
34 int size;
35 while ((size = m_rbuf->remq((int*)m_evtbuf)) == 0) {
36
37
38 usleep(20);
39 }
40
41 EvtMessage* msg = new EvtMessage(m_evtbuf);
42
43 if (msg->
type() == MSG_TERMINATE) {
44 printf("EoF found. Exitting.....\n");
45 m_sock->send(msg);
46 delete msg;
47 return -1;
48 } else {
49 int is = m_sock->send(msg);
50 delete msg;
51 return is;
52
53 }
54}
ERecordType type() const
Get record type.
◆ m_evtbuf
◆ m_rbuf
◆ m_sock
The documentation for this class was generated from the following files: