36 for (
int i = 1; i < 7; ++i ) {
37 pthread_mutex_lock( &m_rpcLock );
40 m_rpc->setData(m_outCode);
41 int size = m_rpc->getSize();
42 void*
data = m_rpc->getData();
43 m_buffer->copy(
data, size);
45 pthread_mutex_unlock( &m_rpcLock );
48 return (
const uint32_t*)m_buffer->data();
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.");
58 std::cout <<
"[NetDataReader] Event " << nn <<
" timeout. Sleep " << sec <<
"s before retry." << std::endl;
60 std::cout <<
"[NetDataReader] Event " << nn <<
" now retry time " << i <<
" ..." << std::endl;
65 throw RawExMessage(
"[NetDataReader] Failed to retry server. Stop this client!");
69 throw RawExMessage(
"[NetDataReader] DistBossServer ERROR !!!");
72 throw RawExMessage(
"[NetDataReader] Unknown server code !!!");
76 throw RawExMessage(
"[NetDataReader] Invalid data from server !!!");