#include <DimRpcWriter.h>
◆ WriterArgType [1/2]
◆ WriterArgType [2/2]
◆ DimRpcWriter() [1/2]
Definition at line 10 of file DimRpcWriter.cxx.
11 : m_inCode(0)
12{
13 if ( name.empty() ) {
14 throw RawExMessage(
"[NetDataWriter] The name of DistBoss Server was not set!");
15 }
16
18
20}
static void registerInstance()
Referenced by DimRpcWriter().
◆ ~DimRpcWriter() [1/2]
DimRpcWriter::~DimRpcWriter |
( |
| ) |
|
|
virtual |
◆ DimRpcWriter() [2/2]
◆ ~DimRpcWriter() [2/2]
virtual DimRpcWriter::~DimRpcWriter |
( |
| ) |
|
|
virtual |
◆ close() [1/2]
int DimRpcWriter::close |
( |
| ) |
|
◆ close() [2/2]
int DimRpcWriter::close |
( |
| ) |
|
◆ stat() [1/2]
int DimRpcWriter::stat |
( |
| ) |
|
◆ stat() [2/2]
int DimRpcWriter::stat |
( |
| ) |
|
◆ writeEvent() [1/2]
int DimRpcWriter::writeEvent |
( |
void * |
pevt, |
|
|
int |
size |
|
) |
| |
Definition at line 27 of file DimRpcWriter.cxx.
28{
29 static int nn = 0;
30 ++nn;
31
32 for ( int i = 1; i < 7; ++i ) {
33 pthread_mutex_lock( &m_rpcLock );
34
35 m_rpc->setData(pevt, size);
36 int inCode = m_rpc->getInt();
37
38 pthread_mutex_unlock( &m_rpcLock );
39
40
43 if ( i < 6 ) {
44 int sec = i;
45 std::cout << "[NetDataWriter] Event " << nn << " timeout. Sleep " << sec << "s before retry." << std::endl;
46 sleep(sec);
47 std::cout << "[NetDataWriter] Event " << nn << " now retry time " << i << " ..." << std::endl;
48 continue;
49 }
50 else {
51 m_inCode = inCode;
52 throw RawExMessage(
"[NetDataWriter] Failed to retry server. Stop this client!");
53 }
54 }
56 m_inCode = inCode;
57 throw RawExMessage(
"[NetDataWriter] Received server ERROR code!");
58 }
59 else {
60 m_inCode = inCode;
61 throw RawExMessage(
"[NetDataWriter] Unknown server code!");
62 }
63 }
64
67 }
68
69 break;
70 }
71
72 return 0;
73}
◆ writeEvent() [2/2]
int DimRpcWriter::writeEvent |
( |
void * |
pevt, |
|
|
int |
size |
|
) |
| |
The documentation for this class was generated from the following files: