Hi everyone, I'm testing the RTT (Round Trip time) in the Local Network with UNET, the results look high, like I said in the topic's title, it get **around 50-60ms**. The RTT on LAN should be lower than that, maybe around 5~10ms.
My testing code is very simple : the Local client send a message to server and save the current time stamp (*sentTime*), when local client receive the reply from server, it compare the current time with the *sentTime* -> got the RTT. Here's the code (very simple)
float _sentTime;
void LocalCheckPingViaCmdRpc()
{
_sentTime = Time.time;
CmdServerReceiveCheckingPingRequest();
}
[Command]
void CmdServerReceiveCheckingPingRequest()
{
RpcClientReceiveCheckingPingMessageFromServer();
}
[ClientRpc]
void RpcClientReceiveCheckingPingMessageFromServer()
{
if (isLocalPlayer)
{
var RTT = (Time.time - _sentTime) * 1000f;
Debug.LogFormat("Cmd, Rpc -> RTT : {0}", RTT);
}
}
You can check out my testing project in [Github][1].
I've also tried use **NetworkMessage**, and switch between **Reliable** and **Unreliable** channel but I got the same results.
If the RTT on LocalNetwork got that high, I think when I deploy my game on a dedicated server, it'll got higher, and that not good for some of my real-time multiplayer projects.
Does anyone face the same problem like this before ? Or I've missed some configurations ? Please give me some advices. Thanks so much.
[1]: https://github.com/ThinhHB/UnityNetworkingTestLocalRTT
↧