do not start server when protocol message is received

This commit is contained in:
Volker Fischer 2006-03-07 21:52:21 +00:00
parent cff359cbaf
commit 5c42d81137
2 changed files with 13 additions and 9 deletions

View file

@ -96,7 +96,7 @@ bool CChannelSet::PutData ( const CVector<unsigned char>& vecbyRecBuf,
const int iNumBytesRead,
const CHostAddress& HostAdr )
{
bool bChanOK = true;
bool bChanOK = false;
Mutex.lock ();
{
@ -115,7 +115,7 @@ bool CChannelSet::PutData ( const CVector<unsigned char>& vecbyRecBuf,
}
else
{
bChanOK = false; /* no free channel available */
/* no free channel available */
}
}
@ -128,10 +128,12 @@ bool CChannelSet::PutData ( const CVector<unsigned char>& vecbyRecBuf,
{
case PS_AUDIO_OK:
PostWinMessage ( MS_JIT_BUF_PUT, MUL_COL_LED_GREEN, iCurChanID );
bChanOK = true; // in case we have an audio packet, return true
break;
case PS_AUDIO_ERR:
PostWinMessage ( MS_JIT_BUF_PUT, MUL_COL_LED_RED, iCurChanID );
bChanOK = true; // in case we have an audio packet, return true
break;
case PS_PROT_ERR:
@ -142,7 +144,7 @@ bool CChannelSet::PutData ( const CVector<unsigned char>& vecbyRecBuf,
}
Mutex.unlock ();
return !bChanOK; /* return 1 if error */
return bChanOK;
}
void CChannelSet::GetBlockAllConC ( CVector<int>& vecChanID,

View file

@ -124,11 +124,13 @@ void CSocket::OnDataReceived ()
else
{
/* server */
// a packet was received, tell the server object to wake up if it
// is in sleep mode (Qt will delete the event object when done)
QThread::postEvent ( pServer,
new CLlconEvent ( MS_PACKET_RECEIVED, 0, 0 ) );
pChannelSet->PutData ( vecbyRecBuf, iNumBytesRead, RecHostAddr );
if ( pChannelSet->PutData ( vecbyRecBuf, iNumBytesRead, RecHostAddr ) )
{
// this was an audio packet, start server
// tell the server object to wake up if it
// is in sleep mode (Qt will delete the event object when done)
QThread::postEvent ( pServer,
new CLlconEvent ( MS_PACKET_RECEIVED, 0, 0 ) );
}
}
}