Restore dashing/eloquent behaviour of "service_is_available" (#190)

* Delete superfluous/erroneous/misleading comment

Signed-off-by: Erik Boasson <eb@ilities.com>

* Check for matched endpoints in server_is_available

Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
eboasson 2020-06-01 21:27:25 +02:00 committed by GitHub
parent 707470e96d
commit c424bc118f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3628,7 +3628,6 @@ extern "C" rmw_ret_t rmw_service_server_is_available(
ret =
common_context->graph_cache.get_writer_count(sub_topic_name, &number_of_response_publishers);
if (ret != RMW_RET_OK || 0 == number_of_response_publishers) {
// error
return ret;
}
dds_publication_matched_status_t ps;
@ -3637,9 +3636,9 @@ extern "C" rmw_ret_t rmw_service_server_is_available(
dds_get_subscription_matched_status(info->client.sub->enth, &cs) < 0)
{
RMW_SET_ERROR_MSG("rmw_service_server_is_available: get_..._matched_status failed");
return RMW_RET_ERROR;
}
// all conditions met, there is a service server available
*is_available = true;
*is_available = ps.current_count > 0 && cs.current_count > 0;
return RMW_RET_OK;
}