From f37cf5ea4a28f395a65155a2c867c42cfc58c76b Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 31 Oct 2019 16:28:30 +0100 Subject: [PATCH] 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. --- Libraries/LibCore/CoreIPCClient.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Libraries/LibCore/CoreIPCClient.h b/Libraries/LibCore/CoreIPCClient.h index d5f93ee7c5..d21cc9ba9e 100644 --- a/Libraries/LibCore/CoreIPCClient.h +++ b/Libraries/LibCore/CoreIPCClient.h @@ -61,14 +61,14 @@ namespace Client { CEventLoop::current().post_event(*this, make(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(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());