1#include "NetDataWriter/DimRpcWriter.h"
2#include "ClientErrHandler/ClientErrHandler.h"
3#include "DistBossUtil/DistBossCode.h"
4#include "IRawFile/RawFileExceptions.h"
8pthread_mutex_t DimRpcWriter::m_rpcLock = PTHREAD_MUTEX_INITIALIZER;
14 throw RawExMessage(
"[NetDataWriter] The name of DistBoss Server was not set!");
32 for (
int i = 1; i < 7; ++i ) {
33 pthread_mutex_lock( &m_rpcLock );
35 m_rpc->setData(pevt, size);
36 int inCode = m_rpc->getInt();
38 pthread_mutex_unlock( &m_rpcLock );
45 std::cout <<
"[NetDataWriter] Event " << nn <<
" timeout. Sleep " << sec <<
"s before retry." << std::endl;
47 std::cout <<
"[NetDataWriter] Event " << nn <<
" now retry time " << i <<
" ..." << std::endl;
52 throw RawExMessage(
"[NetDataWriter] Failed to retry server. Stop this client!");
57 throw RawExMessage(
"[NetDataWriter] Received server ERROR code!");
61 throw RawExMessage(
"[NetDataWriter] Unknown server code!");
static void registerInstance()
const std::string WriterArgType
DimRpcWriter(WriterArgType &name)
int writeEvent(void *pevt, int size)