Skip to content

Commit

Permalink
Don't exit in case connection establishment fails
Browse files Browse the repository at this point in the history
This would prevent client to stop working if agent restarts in
middle of connection initiation. If entity creation fails the
client stop connecting and waiting for next ping response
from agent before next connection attempt.
  • Loading branch information
jnippula committed Nov 16, 2022
1 parent 51a96a7 commit 2d93584
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/modules/microdds_client/microdds_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ void MicroddsClient::run()

if (!uxr_create_session(&session)) {
PX4_ERR("uxr_create_session failed");
return;
continue;
}


Expand All @@ -221,17 +221,17 @@ void MicroddsClient::run()

if (!uxr_run_session_until_all_status(&session, 1000, &participant_req, &request_status, 1)) {
PX4_ERR("create entities failed: participant: %i", request_status);
return;
continue;
}

if (!_subs->init(&session, reliable_out, participant_id)) {
PX4_ERR("subs init failed");
return;
continue;
}

if (!_pubs->init(&session, reliable_out, input_stream, participant_id)) {
PX4_ERR("pubs init failed");
return;
continue;
}

_connected = true;
Expand Down

0 comments on commit 2d93584

Please sign in to comment.