Skip to content

Commit

Permalink
Style nits
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Beardsworth <[email protected]>
  • Loading branch information
mbeards committed May 22, 2024
1 parent 74139f0 commit 1365c06
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
12 changes: 11 additions & 1 deletion include/gz/transport/NodeShared.hh
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,17 @@ namespace gz
public: std::optional<TopicStatistics> TopicStats(
const std::string &_topic) const;

public: void AddGlobalRelay(const std::string& relay_address);
/// \brief Adds a unicast relay IP. All nodes in this process will send
/// UDP unicast traffic to the address to connect networks when UDP
/// multicast traffic is not forwarded.
/// It's also possible to use the environment variable GZ_RELAY to add
/// relays.
/// \param[in] _relayAddress IPv4 address of the relay to add.
public: void AddGlobalRelay(const std::string& _relayAddress);

/// \brief Gets the relay addresses configured for all nodes in this
/// process.
/// \return The relay addresses.
public: std::vector<std::string> GlobalRelays() const;

/// \brief Constructor.
Expand Down
2 changes: 2 additions & 0 deletions src/Node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1140,10 +1140,12 @@ bool Node::RequestRaw(const std::string &_topic,
return executed && res->SerializeToString(&_response);
}

/////////////////////////////////////////////////
void Node::AddGlobalRelay(const std::string& _relayAddress) {
Shared()->AddGlobalRelay(_relayAddress);
}

/////////////////////////////////////////////////
std::vector<std::string> Node::GlobalRelays() const {
return Shared()->GlobalRelays();
}
6 changes: 3 additions & 3 deletions src/NodeShared.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1943,9 +1943,9 @@ int NodeSharedPrivate::NonNegativeEnvVar(const std::string &_envVar,
return numVal;
}

void NodeShared::AddGlobalRelay(const std::string& relay_address) {
dataPtr->msgDiscovery->AddRelayAddress(relay_address);
dataPtr->srvDiscovery->AddRelayAddress(relay_address);
void NodeShared::AddGlobalRelay(const std::string& _relayAddress) {
dataPtr->msgDiscovery->AddRelayAddress(_relayAddress);
dataPtr->srvDiscovery->AddRelayAddress(_relayAddress);
}

std::vector<std::string> NodeShared::GlobalRelays() const {
Expand Down

0 comments on commit 1365c06

Please sign in to comment.