'Unity Netcode for gameobjects with relay - calculate ping

I am having trouble calculating the ping of players in Netcode. I have a list of lobbies, and I want to display the expected ping of each of them, before the client connects. Currently, I am using NetworkManager.Singleton.NetworkConfig.NetworkTransport.GetCurrentRtt(0); to calculate the ping. Is there a way to know the ping before connecting to the relay fully?



Solution 1:[1]

One option would be to run pings outside of the Network Managers

Microsoft has an example of their ping here

You could ping the host to show the ping before the player tries to connect.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 crychair