only fire message for starting the server if the server is not running at the moment

This commit is contained in:
Volker Fischer 2014-01-06 13:04:26 +00:00
parent 215be703a7
commit 81b4416a6f

View file

@ -187,20 +187,14 @@ void CSocket::OnDataReceived()
if ( pServer->PutData ( vecbyRecBuf, iNumBytesRead, RecHostAddr ) )
{
// TODO: we should only post the event in case the server is turned off for
// speed optimization and avoiding possible locks
//if ( !pServer->IsRunning() )
//{
// 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)
// this was an audio packet, start server if it is in sleep mode
if ( !pServer->IsRunning() )
{
// (note that Qt will delete the event object when done)
QCoreApplication::postEvent ( pServer,
new CCustomEvent ( MS_PACKET_RECEIVED, 0, 0 ) );
}
}
}
}
}