Skip to content

Commit

Permalink
Adopt the different congestion control defaults as in Rust (#407)
Browse files Browse the repository at this point in the history
* Adopt the different congestion control defaults as in Rust

* Fix clang-format check

* Use proper internal congestion control functions

* Use proper internal congestion control functions
  • Loading branch information
Mallets authored Feb 13, 2025
1 parent 1ad1415 commit 5dfb68c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion include/zenoh/api/ext/session_ext.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ class SessionExt {
/// Number of samples to keep for each resource.
size_t max_samples = 1;
/// The congestion control to apply to replies.
zenoh::CongestionControl congestion_control = Z_CONGESTION_CONTROL_DEFAULT;
zenoh::CongestionControl congestion_control = ::z_internal_congestion_control_default_response();
/// The priority of replies.
zenoh::Priority priority = ::z_priority_default();
/// If set to ``true``, this cache replies will not be batched. This usually has a positive impact on
Expand Down
6 changes: 3 additions & 3 deletions include/zenoh/api/query.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class Query : public Owned<::z_owned_query_t> {
/// @brief The priority of this reply message.
Priority priority = Z_PRIORITY_DEFAULT;
/// @brief The congestion control to apply when routing this reply message.
CongestionControl congestion_control = Z_CONGESTION_CONTROL_DEFAULT;
CongestionControl congestion_control = ::z_internal_congestion_control_default_response();
/// @brief Whether Zenoh will NOT wait to batch this reply message with others to reduce the bandwith.
bool is_express = false;
/// @brief The timestamp of this message.
Expand Down Expand Up @@ -190,7 +190,7 @@ class Query : public Owned<::z_owned_query_t> {
/// @brief The priority of this reply message.
Priority priority = Z_PRIORITY_DEFAULT;
/// @brief The congestion control to apply when routing this reply message.
CongestionControl congestion_control = Z_CONGESTION_CONTROL_DEFAULT;
CongestionControl congestion_control = ::z_internal_congestion_control_default_response();
/// @brief Whether Zenoh will NOT wait to batch this reply message with others to reduce the bandwith.
bool is_express = false;
/// @brief the timestamp of this message.
Expand Down Expand Up @@ -245,4 +245,4 @@ class Query : public Owned<::z_owned_query_t> {
};

} // namespace zenoh
#endif
#endif
10 changes: 5 additions & 5 deletions include/zenoh/api/session.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class Session : public Owned<::z_owned_session_t> {
/// @brief The priority of the get message.
Priority priority = Z_PRIORITY_DEFAULT;
/// @brief The congestion control to apply when routing get message.
CongestionControl congestion_control = Z_CONGESTION_CONTROL_DEFAULT;
CongestionControl congestion_control = ::z_internal_congestion_control_default_request();
/// @brief Whether Zenoh will NOT wait to batch get message with others to reduce the bandwith.
bool is_express = false;
/// @brief An optional payload of the query.
Expand Down Expand Up @@ -526,7 +526,7 @@ class Session : public Owned<::z_owned_session_t> {
/// @brief The priority of the delete message.
Priority priority = Z_PRIORITY_DEFAULT;
/// @brief The congestion control to apply when routing delete message.
CongestionControl congestion_control = Z_CONGESTION_CONTROL_DEFAULT;
CongestionControl congestion_control = ::z_internal_congestion_control_default_push();
/// @brief Whether Zenoh will NOT wait to batch delete message with others to reduce the bandwith.
bool is_express = false;
#if defined(Z_FEATURE_UNSTABLE_API)
Expand Down Expand Up @@ -571,7 +571,7 @@ class Session : public Owned<::z_owned_session_t> {
/// @brief The priority of this message.
Priority priority = Z_PRIORITY_DEFAULT;
/// @brief The congestion control to apply when routing this message.
CongestionControl congestion_control = Z_CONGESTION_CONTROL_DEFAULT;
CongestionControl congestion_control = ::z_internal_congestion_control_default_push();
/// @brief Whether Zenoh will NOT wait to batch this message with others to reduce the bandwith.
bool is_express = false;
#if defined(ZENOHCXX_ZENOHC) && defined(Z_FEATURE_UNSTABLE_API)
Expand Down Expand Up @@ -640,7 +640,7 @@ class Session : public Owned<::z_owned_session_t> {
/// @name Fields

/// @brief The congestion control to apply when routing messages from this publisher.
CongestionControl congestion_control = Z_CONGESTION_CONTROL_DEFAULT;
CongestionControl congestion_control = ::z_internal_congestion_control_default_push();
/// @brief The priority of messages from this publisher.
Priority priority = Z_PRIORITY_DEFAULT;
/// @brief If ``true``, Zenoh will not wait to batch this message with others to reduce the bandwith.
Expand Down Expand Up @@ -717,7 +717,7 @@ class Session : public Owned<::z_owned_session_t> {
/// @brief The priority of the querier queries.
Priority priority = Z_PRIORITY_DEFAULT;
/// @brief The congestion control to apply when routing querier queries.
CongestionControl congestion_control = Z_CONGESTION_CONTROL_DEFAULT;
CongestionControl congestion_control = ::z_internal_congestion_control_default_request();
/// @brief Whether Zenoh will NOT wait to batch querier queries with other messages to reduce the bandwith.
bool is_express = false;
#if defined(ZENOHCXX_ZENOHC) && defined(Z_FEATURE_UNSTABLE_API)
Expand Down

0 comments on commit 5dfb68c

Please sign in to comment.