Quellcode durchsuchen

LibCore: Only wait 10ms between IPC connection retries instead of 1 sec

This makes startup feel way faster in case the WindowServer is not yet
available when we try connecting to it from Taskbar, Terminal, etc.
Andreas Kling vor 5 Jahren
Ursprung
Commit
f37cf5ea4a
1 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen
  1. 4 4
      Libraries/LibCore/CoreIPCClient.h

+ 4 - 4
Libraries/LibCore/CoreIPCClient.h

@@ -61,14 +61,14 @@ namespace Client {
                 CEventLoop::current().post_event(*this, make<PostProcessEvent>(m_connection->fd()));
             };
 
-            int retries = 1000;
+            int retries = 100000;
             while (retries) {
                 if (m_connection->connect(CSocketAddress::local(address))) {
                     break;
                 }
 
                 dbgprintf("Client::Connection: connect failed: %d, %s\n", errno, strerror(errno));
-                sleep(1);
+                usleep(10000);
                 --retries;
             }
             ASSERT(m_connection->is_connected());
@@ -260,14 +260,14 @@ namespace Client {
                 CEventLoop::current().post_event(*this, make<PostProcessEvent>(m_connection->fd()));
             };
 
-            int retries = 1000;
+            int retries = 100000;
             while (retries) {
                 if (m_connection->connect(CSocketAddress::local(address))) {
                     break;
                 }
 
                 dbgprintf("Client::Connection: connect failed: %d, %s\n", errno, strerror(errno));
-                sleep(1);
+                usleep(10000);
                 --retries;
             }
             ASSERT(m_connection->is_connected());