Skip to content

Commit ad39960

Browse files
committed
Document for pickOneAddress().
1 parent 316ea60 commit ad39960

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

flow/include/flow/network.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,8 @@ class INetworkConnections {
736736
return static_cast<INetworkConnections*>((void*)g_network->global(INetwork::enNetworkConnections));
737737
}
738738

739+
// If a DNS name can be resolved to both and IPv4 and IPv6 addresses, we want IPv6 addresses when running the clusters on IPv6.
740+
// This function takes a vector of addresses and return a random one, preferring IPv6 over IPv4.
739741
static NetworkAddress pickOneAddress(const std::vector<NetworkAddress>& addresses) {
740742
std::vector<NetworkAddress> ipV6Addresses;
741743
for (const NetworkAddress& addr : addresses) {

0 commit comments

Comments
 (0)