From 72af5d521720c9357a3390d790edcdb226e88453 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 3 Nov 2019 14:26:13 -0800 Subject: [PATCH] Update initial PC state more quickly on launch --- Limelight/Network/DiscoveryWorker.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Limelight/Network/DiscoveryWorker.m b/Limelight/Network/DiscoveryWorker.m index 0c7fb39..c2f9788 100644 --- a/Limelight/Network/DiscoveryWorker.m +++ b/Limelight/Network/DiscoveryWorker.m @@ -89,8 +89,9 @@ static const float POLL_RATE = 2.0f; // Poll every 2 seconds Log(LOG_D, @"%@ has %d unique addresses", _host.name, [addresses count]); - // Give the PC 2 tries to respond before declaring it offline - for (int i = 0; i < 2; i++) { + // Give the PC 2 tries to respond before declaring it offline if we've seen it before. + // If this is an unknown PC, update the status after 1 attempt to get the UI refreshed quickly. + for (int i = 0; i < (_host.state == StateUnknown ? 1 : 2); i++) { for (NSString *address in addresses) { if (self.cancelled) { // Get out without updating the status because