These source codes are of great reference value and can be used for commercial applications.
Note: although the version is simplified, the Data Interaction Between UDP and TCP is completely complete.
In summary, the Code has become very simple, with less than 1000 lines of logic code completely penetrated (W lines of code ^-^ on some P2P modules ).
The actual penetration rate of game operations is about 70%.
Compile and run
1. Compile include/Herm first.
2. Compile tcp_relayd & udp_relayd. The two are P2P penetration assisting servers and the forwarding server when P2P is disconnected.
3. Compile ghost. This is a simple test client.
4. Execute sync. BAT and start tcp_relayd & udp_relayd in Bin. bin2 and bin3 start two Ghost clients.
Note: The server code shared here is a simple and casual server. Actually, you must complete it.
:
Http://download.csdn.net/detail/herm_lib/4788209