UNET : RTT on Local Network look high (around 50~60)
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. 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.
Hey, I have similar issue here, no answers: https://answers.unity.com/questions/1696469/unity-unet-command-clientrpc-roundtrip-time-is-une.html
Your answer
![](https://koobas.hobune.stream/wayback/20220612115847im_/https://answers.unity.com/themes/thub/images/avi.jpg)