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:
parent
4a6c4f0e52
commit
563ff31fe3
1 changed files with 13 additions and 0 deletions
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue