1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-25 16:48:44 +02:00

Reduce retry time during startup

This is the total time before it is decided a defunct socket
was left behind.
This commit is contained in:
Leland Lucius 2020-03-12 17:59:56 -05:00
parent c5ed9b37be
commit 279e96072b

View File

@ -1928,9 +1928,9 @@ bool AudacityApp::CreateSingleInstanceChecker(const wxString &dir)
Destroy_ptr<wxSocketClient> sock { safenew wxSocketClient() }; Destroy_ptr<wxSocketClient> sock { safenew wxSocketClient() };
sock->SetFlags(wxSOCKET_WAITALL); sock->SetFlags(wxSOCKET_WAITALL);
// We try up to 50 times since there's a small window // We try up to 20 times since there's a small window
// where the server may not have been fully initialized. // where the server may not have been fully initialized.
for (int i = 0; i < 50; ++i) for (int i = 0; i < 20; ++i)
{ {
// Attempt to connect to an active Audacity. // Attempt to connect to an active Audacity.
sock->Connect(addr, true); sock->Connect(addr, true);
@ -1970,6 +1970,11 @@ bool AudacityApp::CreateSingleInstanceChecker(const wxString &dir)
} }
wxMilliSleep(100); wxMilliSleep(100);
if (i == 0)
{
printf("Attempting to connect to Audacity failed...retrying\n");
}
} }
// At this point, we've exhausted our connections attempts. So, we assume // At this point, we've exhausted our connections attempts. So, we assume