|
|
|
@ -38,12 +38,12 @@ transportSocket::transportSocket() : basicTransport(), basicDualThread(){ |
|
|
|
|
|
|
|
// Destructor implementation
|
|
|
|
transportSocket::~transportSocket(){ |
|
|
|
# ifdef DEBUG
|
|
|
|
# ifdef DEBUG_EXTRA
|
|
|
|
LOG("Destructor begin!"); |
|
|
|
# endif
|
|
|
|
m_mBufferProtectorMutex.unlock(); |
|
|
|
_close(); |
|
|
|
# ifdef DEBUG
|
|
|
|
# ifdef DEBUG_EXTRA
|
|
|
|
LOG("Destructor end!"); |
|
|
|
# endif
|
|
|
|
}; |
|
|
|
@ -57,23 +57,23 @@ bool transportSocket::create( void ){ |
|
|
|
|
|
|
|
bool transportSocket::_close( void ){ |
|
|
|
setConnectionStatus( CS_DISCONNECTED ); |
|
|
|
LOG("Sending Close Req!"); |
|
|
|
//LOG("Sending Close Req!");
|
|
|
|
if( m_iControlPipeFD[0] > -1 ){ |
|
|
|
LOG("Sending Close Req[1]!"); |
|
|
|
//LOG("Sending Close Req[1]!");
|
|
|
|
write( m_iControlPipeFD[0], "E", 1 ); |
|
|
|
}; |
|
|
|
if( m_iControlPipeFD[1] > -1 ){ |
|
|
|
LOG("Sending Close Req[2]!"); |
|
|
|
//LOG("Sending Close Req[2]!");
|
|
|
|
write( m_iControlPipeFD[1], "E", 1 ); |
|
|
|
}; |
|
|
|
if( m_bInitComplete ) m_bInitComplete = !uninit(); |
|
|
|
LOG("Closeing FIDs!"); |
|
|
|
//LOG("Closeing FIDs!");
|
|
|
|
if ( m_iControlPipeFD[0] > -1 ){ |
|
|
|
LOG("Closeing FIDs[1]!"); |
|
|
|
//LOG("Closeing FIDs[1]!");
|
|
|
|
close( m_iControlPipeFD[0] ); |
|
|
|
}; |
|
|
|
if ( m_iControlPipeFD[1] > -1 ){ |
|
|
|
LOG("Closeing FIDs[2]!"); |
|
|
|
//LOG("Closeing FIDs[2]!");
|
|
|
|
close( m_iControlPipeFD[1] ); |
|
|
|
}; |
|
|
|
return true; |
|
|
|
@ -132,14 +132,14 @@ void transportSocket::m_fThreadAProc(void){ |
|
|
|
if ( buffer == 'E' ) { |
|
|
|
//m_bThreadBStatus = TH_ENDED;
|
|
|
|
m_bThreadAStatus = TH_ENDED; |
|
|
|
LOG("Requesting Destruction of Transport[s]!"); |
|
|
|
//LOG("Requesting Destruction of Transport[s]!");
|
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|
LOG("Sender Thread End!"); |
|
|
|
//LOG("Sender Thread End!");
|
|
|
|
}; |
|
|
|
|
|
|
|
void transportSocket::m_fThreadBProc(void){ |
|
|
|
@ -177,8 +177,10 @@ void transportSocket::m_fThreadBProc(void){ |
|
|
|
setConnectionStatus(CS_DISCONNECTED); |
|
|
|
m_nInputBufferSize = 0; |
|
|
|
m_bThreadBStatus = TH_ENDED; |
|
|
|
//m_bThreadAStatus = TH_ENDED;
|
|
|
|
//m_bThreadAStatus = TH_ENDED;
|
|
|
|
#ifdef DEBUG_EXTRA
|
|
|
|
LOG_ERROR("Connection Droped on Reception Data"); |
|
|
|
#endif
|
|
|
|
} else if( m_nInputBufferSize > 0 ){ |
|
|
|
do{ |
|
|
|
m_mQueueProtectorMutex.lock(); |
|
|
|
@ -203,7 +205,9 @@ void transportSocket::m_fThreadBProc(void){ |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|
#ifdef DEBUG_EXTRA
|
|
|
|
LOG("Recipient Thread End!"); |
|
|
|
#endif
|
|
|
|
}; |
|
|
|
|
|
|
|
bool transportSocket::sendData(unsigned char *Data, int DataSize){ |
|
|
|
|