From cb3b0bd37398ba66a99723337d87401f667fec8e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 8 Dec 2018 12:36:30 +1100 Subject: [PATCH] SITL: don't try to connect Morse sockets so quickly --- libraries/SITL/SIM_Morse.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libraries/SITL/SIM_Morse.cpp b/libraries/SITL/SIM_Morse.cpp index e27c17c52a..b9bb5d4ab8 100644 --- a/libraries/SITL/SIM_Morse.cpp +++ b/libraries/SITL/SIM_Morse.cpp @@ -262,7 +262,8 @@ bool Morse::connect_sockets(void) AP_HAL::panic("Out of memory for sensors socket"); } if (!sensors_sock->connect(morse_ip, morse_sensors_port)) { - if (connect_counter++ == 1000) { + usleep(100000); + if (connect_counter++ == 20) { printf("Waiting to connect to sensors control on %s:%u\n", morse_ip, morse_sensors_port); connect_counter = 0; @@ -280,7 +281,8 @@ bool Morse::connect_sockets(void) AP_HAL::panic("Out of memory for control socket"); } if (!control_sock->connect(morse_ip, morse_control_port)) { - if (connect_counter++ == 1000) { + usleep(100000); + if (connect_counter++ == 20) { printf("Waiting to connect to control control on %s:%u\n", morse_ip, morse_control_port); connect_counter = 0;