Skip to content

Commit

Permalink
SITL: correct diagnostic message obout what AirSim-in addr we bound
Browse files Browse the repository at this point in the history
Co-authored-by: Oleksiy Protas <[email protected]>
  • Loading branch information
peterbarker and landswellsong committed Apr 11, 2024
1 parent b849fbb commit 93c1530
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libraries/SITL/SIM_AirSim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,14 @@ AirSim::AirSim(const char *frame_str) :
*/
void AirSim::set_interface_ports(const char* address, const int port_in, const int port_out)
{
if (!sock.bind("0.0.0.0", port_in)) {
static const char *port_in_addr = "0.0.0.0";

if (!sock.bind(port_in_addr, port_in)) {
printf("Unable to bind Airsim sensor_in socket at port %u - Error: %s\n",
port_in, strerror(errno));
return;
}
printf("Bind SITL sensor input at %s:%u\n", "127.0.0.1", port_in);
printf("Bind SITL sensor input at %s:%u\n", port_in_addr, port_in);
sock.set_blocking(false);
sock.reuseaddress();

Expand Down

0 comments on commit 93c1530

Please sign in to comment.