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