Share a P2P component for commercial applications that support TCP and UDP penetration

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.