|
|
|
@ -29,11 +29,12 @@ transportSocket::transportSocket() : basicTransport(), basicDualThread(){ |
|
|
|
|
|
|
|
// Destructor implementation
|
|
|
|
transportSocket::~transportSocket(){ |
|
|
|
# ifdef DEBUG_EXTRA
|
|
|
|
# ifdef DEBUG
|
|
|
|
LOG("Destructor begin!"); |
|
|
|
# endif
|
|
|
|
m_mBufferProtectorMutex.unlock(); |
|
|
|
uninit(); |
|
|
|
# ifdef DEBUG_EXTRA
|
|
|
|
# ifdef DEBUG
|
|
|
|
LOG("Destructor end!"); |
|
|
|
# endif
|
|
|
|
}; |
|
|
|
@ -54,7 +55,7 @@ void transportSocket::m_fThreadAProc(void){ |
|
|
|
#endif
|
|
|
|
while (m_bThreadAStatus < TH_ENDED) { |
|
|
|
m_mBufferProtectorMutex.lock(); |
|
|
|
if( m_nOutputBufferSize > 0 ){ |
|
|
|
if( m_nOutputBufferSize > 0 && m_bThreadAStatus < TH_ENDED ){ |
|
|
|
index = 0; |
|
|
|
while ((index < m_nOutputBufferSize) && (m_bThreadAStatus < TH_ENDED)){ |
|
|
|
RetVal = sendBlock(m_pOutputBuffer + index, m_nOutputBufferSize - index); |
|
|
|
@ -71,7 +72,7 @@ void transportSocket::m_fThreadAProc(void){ |
|
|
|
m_mBufferProtectorMutex.unlock(); |
|
|
|
} else { |
|
|
|
m_mBufferProtectorMutex.unlock(); |
|
|
|
usleep(100); |
|
|
|
if( m_bThreadAStatus < TH_ENDED ) usleep(100); |
|
|
|
}; |
|
|
|
}; |
|
|
|
LOG("Sender Thread End!"); |
|
|
|
@ -104,11 +105,11 @@ void transportSocket::m_fThreadBProc(void){ |
|
|
|
#ifdef DEBUG_EXTRA
|
|
|
|
LOG_ERROR("Try to parse data but No Parsers Assigned!"); |
|
|
|
#endif
|
|
|
|
SLEEP(100); |
|
|
|
if( m_bThreadAStatus < TH_ENDED ) usleep(100); |
|
|
|
}; |
|
|
|
} while( ( m_vParsers.size() == 0 ) && ( m_bThreadBStatus < TH_ENDED ) && ( m_bThreadBStatus < TH_ENDED ) ); |
|
|
|
} else { |
|
|
|
usleep(100); |
|
|
|
if( m_bThreadAStatus < TH_ENDED ) usleep(100); |
|
|
|
}; |
|
|
|
}; |
|
|
|
LOG("Recipient Thread End!"); |
|
|
|
|