diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-01-02 11:33:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-02 11:33:30 +0100 |
commit | 4973b7a513c8ac52159948f825dc67d7e29e2626 (patch) | |
tree | 3cb2277e471ca6f7dae66d515d25b61ab4912380 | |
parent | d7d8fc6c207c80896a3da7dbdbb35d57df4bcb86 (diff) | |
parent | e6d83a766a7adf6193d9f0dfbb08b16702616199 (diff) |
Merge pull request #14916 from poke1024/reduce-startup-time
Ramp up remote debugger wait time
-rw-r--r-- | core/script_debugger_remote.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/core/script_debugger_remote.cpp b/core/script_debugger_remote.cpp index 27633ec553..a2505cbc53 100644 --- a/core/script_debugger_remote.cpp +++ b/core/script_debugger_remote.cpp @@ -67,17 +67,20 @@ Error ScriptDebuggerRemote::connect_to_host(const String &p_host, uint16_t p_por int port = p_port; - int tries = 3; + const int tries = 6; + int waits[tries] = { 1, 10, 100, 1000, 1000, 1000 }; + tcp_client->connect_to_host(ip, port); - while (tries--) { + for (int i = 0; i < tries; i++) { if (tcp_client->get_status() == StreamPeerTCP::STATUS_CONNECTED) { break; } else { - OS::get_singleton()->delay_usec(1000000); - print_line("Remote Debugger: Connection failed with status: '" + String::num(tcp_client->get_status()) + "', retrying in 1 sec."); + const int ms = waits[i]; + OS::get_singleton()->delay_usec(ms * 1000); + print_line("Remote Debugger: Connection failed with status: '" + String::num(tcp_client->get_status()) + "', retrying in " + String::num(ms) + " msec."); }; }; |