!!! WARNINGS !!!
ProudNet kindly provides a walk around method of using ProudNet's hole-punched information in other 3rd party network engines. (Surely we don't recommend this!)
ProudNet has Earning hole-punched address of client function. Through this, you can obtain the complete hole-punched information between client and server or P2P and based on this information, you can have a separated UDP socket that handles communication without using ProudNet. However, there are few things you need to be careful about.
- The hole-punched information of ProudNet is information that is mapped by router for UDP socket included in Proud.CNetClient. So the UDP socket owned by PoudNet. CNetClient must be set to off. In order to this, first Proud.CNetClient.Disconnect call or Proud. CNetClient object must be destroyed. Then the UDP socket owned by Proud.CNetClient must be addressed to 3rd party. Without these preset conditions, the UDP socket of ProudNet and 3rd Party would not work appropriately since it is repatative.
- WARNINGS
Here are the steps.
- First, use Proud.CNetClient.GetDirectP2PInfo to obtain the hole-punched information.
- Then the UDP socket owned by ProudNet must be released. Proud.CNetClient.InvalidateUdpSocket closes the UDP socket of Proud.CNetClient. Fortunately the hole-punching status of router holds up. The returned value of Proud.CNetClient.InvalidateUdpSocket can be used in communication between peers from a separated module.
- After calling for Proud.CNetClient.InvalidateUdpSocket, if you use Proud. CNetClient.RestoreUdpSocket, it creates a fresh UDP socket and re-establishes UDP communication betwwen peers or with server.
- For some routers, sometimes the hole-punching mapping gets altered arbitrarily or disappears after tens of seconds or minutes passed. ProudNet also fixes this problem automatically with the custom relay fallback functionality. But if you are 3rd party UDP socket, such problem can only be solved by yourself or support from 3rd party engine. Otherwise, there is a high chance of P2P communication failure.
Reference: There is a chance that ProudNet may use UPnP in a later version. When this update takes place, it could affect the above mechanism. Please always check the release note for possible changes.