low channel time out value, fix for disconnect protocol message (we indeed require a counter, otherwise sending multiple disconnect messages would not work)

This commit is contained in:
Volker Fischer 2009-09-07 19:54:46 +00:00
parent 5a807e4381
commit 8734ee8092
2 changed files with 14 additions and 5 deletions

View file

@ -39,7 +39,7 @@
// Set the time-out for the input buffer until the state changes from // Set the time-out for the input buffer until the state changes from
// connected to not connected (the actual time depends on the way the error // connected to not connected (the actual time depends on the way the error
// correction is implemented) // correction is implemented)
#define CON_TIME_OUT_SEC_MAX 60 // seconds #define CON_TIME_OUT_SEC_MAX 30 // seconds
enum EPutDataStat enum EPutDataStat
{ {

View file

@ -917,11 +917,20 @@ bool CProtocol::EvaluateReqNetwTranspPropsMes ( const CVector<uint8_t>& vecData
void CProtocol::CreateAndImmSendDisconnectionMes() void CProtocol::CreateAndImmSendDisconnectionMes()
{ {
CVector<uint8_t> vecDisconMessage; CVector<uint8_t> vecDisconMessage;
int iCurCounter;
// build complete message (special case, there is not actual data Mutex.lock();
// and we do not use the counter since this is the very last message {
// of the connection, after that no message will be evaluated) // store current counter value
GenMessageFrame ( vecDisconMessage, 0, iCurCounter = iCounter;
// increase counter (wraps around automatically)
iCounter++;
}
Mutex.unlock();
// build complete message
GenMessageFrame ( vecDisconMessage, iCurCounter,
PROTMESSID_DISCONNECTION, CVector<uint8_t> ( 0 ) ); PROTMESSID_DISCONNECTION, CVector<uint8_t> ( 0 ) );
// immediately send acknowledge message // immediately send acknowledge message