Skip to content

Commit 1e701da

Browse files
SITL: correct diagnostic message obout what AirSim-in addr we bound
Co-authored-by: Oleksiy Protas <[email protected]>
1 parent 5df7d06 commit 1e701da

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

libraries/SITL/SIM_AirSim.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,14 @@ AirSim::AirSim(const char *frame_str) :
5555
*/
5656
void AirSim::set_interface_ports(const char* address, const int port_in, const int port_out)
5757
{
58-
if (!sock.bind("0.0.0.0", port_in)) {
58+
static const char *port_in_addr = "0.0.0.0";
59+
60+
if (!sock.bind(port_in_addr, port_in)) {
5961
printf("Unable to bind Airsim sensor_in socket at port %u - Error: %s\n",
6062
port_in, strerror(errno));
6163
return;
6264
}
63-
printf("Bind SITL sensor input at %s:%u\n", "127.0.0.1", port_in);
65+
printf("Bind SITL sensor input at %s:%u\n", port_in_addr, port_in);
6466
sock.set_blocking(false);
6567
sock.reuseaddress();
6668

0 commit comments

Comments
 (0)