mirror of https://github.com/ArduPilot/ardupilot
SITL: use connect_timeout() for realflight
this gives much better handling of network glitches, preventing long simulation timeouts which impact on the stability of the simulation
This commit is contained in:
parent
26823b56ae
commit
928d50900a
|
@ -595,7 +595,11 @@ void FlightAxis::socket_creator(void)
|
|||
usleep(500);
|
||||
continue;
|
||||
}
|
||||
if (!sck->connect(controller_ip, controller_port)) {
|
||||
/*
|
||||
don't let the connection take more than 100ms (10Hz). Longer
|
||||
than this and we are better off trying for a new socket
|
||||
*/
|
||||
if (!sck->connect_timeout(controller_ip, controller_port, 100)) {
|
||||
::printf("connect failed\n");
|
||||
delete sck;
|
||||
usleep(5000);
|
||||
|
|
Loading…
Reference in New Issue