mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-04-05 06:34:25 -04:00
Wait up to 5 seconds for the local server connection to retrieve all controllers before continuing, so that CLI mode has all controllers available for applying changes
This commit is contained in:
13
main.cpp
13
main.cpp
@@ -129,6 +129,19 @@ bool AttemptLocalConnection()
|
||||
ResourceManager::get()->RegisterNetworkClient(client);
|
||||
|
||||
success = true;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Wait up to 5 seconds for the client connection to |
|
||||
| retrieve all controllers |
|
||||
\*-----------------------------------------------------*/
|
||||
for(int timeout = 0; timeout < 1000; timeout++)
|
||||
{
|
||||
if(client->GetOnline())
|
||||
{
|
||||
break;
|
||||
}
|
||||
std::this_thread::sleep_for(5ms);
|
||||
}
|
||||
}
|
||||
|
||||
return success;
|
||||
|
||||
Reference in New Issue
Block a user