mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Fixed performance bug in standalone netconsole
When unconnected, the frame loop would run as fast as it could. Moved thread sleeper at the bottom in the outer scope of the function to prevent this behavior in all cases.
This commit is contained in:
parent
096091e56f
commit
9287f00841
@ -200,9 +200,7 @@ void CNetCon::RunFrame(void)
|
||||
{
|
||||
if (m_bConnEstablished)
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
||||
std::lock_guard<std::mutex> l(m_Mutex);
|
||||
|
||||
this->Recv();
|
||||
}
|
||||
else if (m_bPromptConnect)
|
||||
@ -210,6 +208,7 @@ void CNetCon::RunFrame(void)
|
||||
DevMsg(eDLL_T::NONE, "Enter [<IP>]:<PORT> or <IP> <PORT>: ");
|
||||
m_bPromptConnect = false;
|
||||
}
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user