|
| RawRevSock2Rb (std::string rbuf, std::string src, int port, std::string shmname, int id) |
| Constuctor and Destructor.
|
|
int | ReceiveEvent (void) |
| Event function.
|
|
int | Reconnect (int ntry) |
| Reconnect.
|
|
Definition at line 19 of file RawRevSock2Rb.h.
◆ RawRevSock2Rb()
RawRevSock2Rb |
( |
std::string |
rbuf, |
|
|
std::string |
src, |
|
|
int |
port, |
|
|
std::string |
shmname, |
|
|
int |
id |
|
) |
| |
Constuctor and Destructor.
Definition at line 17 of file RawRevSock2Rb.cc.
18{
19
22 m_evtbuf = new char[MAXEVTSIZE];
23 m_flow =
new RFFlowStat((
char*)shmname.c_str(),
id, m_rbuf);
24 m_buf = new int[MAXBUFSIZE];
25
26}
Class to manage a Ring Buffer placed in an IPC shared memory.
◆ ~RawRevSock2Rb()
Definition at line 28 of file RawRevSock2Rb.cc.
29{
30 delete m_sock;
31 delete m_rbuf;
32}
◆ ReceiveEvent()
int ReceiveEvent |
( |
void |
| ) |
|
Event function.
Definition at line 34 of file RawRevSock2Rb.cc.
35{
36
37 int bufsize = m_sock->get_wordbuf(m_buf, MAXBUFSIZE);
38
39 if (bufsize <= 0) {
40 return 0;
41 }
42 m_flow->log(bufsize * 4);
43
44
45 int stat = 0;
46 for (;;) {
47 stat = m_rbuf->
insq(m_buf, bufsize);
48 if (stat >= 0) break;
49
50 usleep(20);
51 }
52 return stat;
53}
int insq(const int *buf, int size, bool checkTx=false)
Append a buffer to the RingBuffer.
◆ Reconnect()
int Reconnect |
( |
int |
ntry | ) |
|
Reconnect.
Definition at line 55 of file RawRevSock2Rb.cc.
56{
57 return m_sock->reconnect(ntimes);
58}
◆ m_buf
◆ m_evtbuf
◆ m_flow
◆ m_rbuf
◆ m_sock
The documentation for this class was generated from the following files: