#include <DimRpcReader.h>
Definition at line 10 of file DimRpcReader.h.
◆ ReaderArgType
◆ DimRpcReader()
Definition at line 11 of file DimRpcReader.cxx.
12{
13 if ( name.empty() ) {
14 throw RawExMessage(
"[NetDataReader] The name of DistBoss EvtServer was not set!");
15 }
16
18
20
22}
static void registerInstance()
Referenced by DimRpcReader().
◆ ~DimRpcReader()
DimRpcReader::~DimRpcReader |
( |
| ) |
|
|
virtual |
◆ currentEvent()
const uint32_t * DimRpcReader::currentEvent |
( |
| ) |
const |
◆ currentFile()
std::string DimRpcReader::currentFile |
( |
| ) |
|
Definition at line 90 of file DimRpcReader.cxx.
91{
92 pthread_mutex_lock( &m_rpcLock );
93
95 m_rpc->setData(m_outCode);
96
97 std::string fname((char*)m_rpc->getData());
98
99 pthread_mutex_unlock( &m_rpcLock );
100
101 return fname;
102}
◆ nextEvent()
const uint32_t * DimRpcReader::nextEvent |
( |
| ) |
|
Definition at line 29 of file DimRpcReader.cxx.
30{
31 static int nn = 0;
32 ++nn;
33
35
36 for ( int i = 1; i < 7; ++i ) {
37 pthread_mutex_lock( &m_rpcLock );
38
39 m_outCode = theCode;
40 m_rpc->setData(m_outCode);
41 int size = m_rpc->getSize();
42 void*
data = m_rpc->getData();
44
45 pthread_mutex_unlock( &m_rpcLock );
46
47 if ( size > 4 ) {
48 return (
const uint32_t*)m_buffer->
data();
49 }
50 else if ( size == 4 ) {
51 m_inCode = *((
const uint32_t*)m_buffer->
data());
53 throw RawExMessage(
"[NetDataReader] Reach the end, no more events left.");
54 }
56 if ( i < 6 ) {
57 int sec = i;
58 std::cout << "[NetDataReader] Event " << nn << " timeout. Sleep " << sec << "s before retry." << std::endl;
59 sleep(sec);
60 std::cout << "[NetDataReader] Event " << nn << " now retry time " << i << " ..." << std::endl;
62 continue;
63 }
64 else {
65 throw RawExMessage(
"[NetDataReader] Failed to retry server. Stop this client!");
66 }
67 }
69 throw RawExMessage(
"[NetDataReader] DistBossServer ERROR !!!");
70 }
71 else {
72 throw RawExMessage(
"[NetDataReader] Unknown server code !!!");
73 }
74 }
75 else {
76 throw RawExMessage(
"[NetDataReader] Invalid data from server !!!");
77 }
78
79 break;
80 }
81
82 return 0;
83}
void copy(void *src, int size)
◆ stat()
uint32_t DimRpcReader::stat |
( |
| ) |
|
The documentation for this class was generated from the following files: