Performance difference between Direct P2P and relay communication

As explained in Overview of peer-to-peer communication between clients, peer-to-peer communication between hosts is based in 2 different methods, Direct P2P or relay communication.

Generally speaking, the latency of P2P communication two times larger than that of relay communication. Especially when the server is physically far away (for instance, if the server is located further than 3,000 kilometers), the gab will grow larger and larger.

Therefore, it is suggested to consider as followed.

  • How to reduce the total number of P2P messaging(RMI call) in relay communication : With Proud.CNetClient.GetPeerInfo, you can find out whether or not you are in Direct P2P communication with another client who will receive RMI call. For instance, if you are in relay communication then you can reduce the number of RMI call for your character position from 8 times per second to 4 times per second.

But there is an advantage in using relay communication too. When there are many of P2P group members, it will cause excessive amount of uploads if client passes RMI to that P2P group. For solution to this, refer to Proud.RmiContext.m_maxDirectP2PMulticastCount or Transmitting the latest message only.