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
// connected to not connected (the actual time depends on the way the error
// correction is implemented)
#define CON_TIME_OUT_SEC_MAX 60 // seconds
#define CON_TIME_OUT_SEC_MAX 30 // seconds
enum EPutDataStat
{

View file

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