这是本人以前做过的商业项目的P2P方面的简化版本, 支持udp&tcp的p2p穿透.
这些源码非常有参考价值, 实际的商业应用可以借鉴。
注意, 虽然是简化版本, 但udp&tcp穿透, 数据交互是完全完整的, 穿透这块经过本人几个项目的
总结, 代码已经变得非常简单, 全部穿透的逻辑代码不到1000行(有的项目P2P模块上W行代码^-^)。
实际游戏运营的穿透率是70%左右。
编译和运行
1. 先编译include/herm.
2. 编译tcp_relayd&udp_relayd, 这两个是P2P穿透协助服务器, 同时也是P2P不通时的转发服务器.
3. 编译ghost, 这个是简单测试客户端.
4. 执行一下sync.bat, bin里启动tcp_relayd&udp_relayd; bin2和bin3启动两个ghost client.
欢迎大家通过下面的联系方式和本人交流。
email: daemon.huang@gmail.com
qq: 664228269
没有合适的资源?快使用搜索试试~ 我知道了~
商业级支持tcp&udp;穿透的p2p组件
共158个文件
h:82个
cpp:53个
vcproj:6个
3星 · 超过75%的资源 需积分: 9 39 下载量 60 浏览量
2012-11-20
10:05:01
上传
评论 1
收藏 134KB RAR 举报
温馨提示
支持tcp&udp;穿透的p2p组件,在多个商业项目中有应用,实际穿透率达70%左右。
资源推荐
资源详情
资源评论
收起资源包目录
商业级支持tcp&udp;穿透的p2p组件 (158个子文件)
sync.bat 299B
sync_release.bat 293B
tcp_relayd.conf 247B
udp_relayd.conf 243B
ghost.conf 172B
ghost.conf 168B
ghost.conf 168B
demo.conf 131B
udp_peer.cpp 11KB
ghost_dlg.cpp 7KB
network.cpp 7KB
sock_buffer.cpp 6KB
tcp_session.cpp 6KB
socket_def.cpp 5KB
socket_base.cpp 5KB
path.cpp 4KB
log.cpp 4KB
user.cpp 4KB
stream.cpp 4KB
multiplexor_impl.cpp 4KB
misc.cpp 4KB
msg_base.cpp 3KB
tc_peer.cpp 3KB
handler_mgr.cpp 3KB
multiplexor_impl.cpp 3KB
buffer.cpp 3KB
msg_dispatcher.cpp 3KB
timer_mgr.cpp 3KB
channel.cpp 3KB
tcp_channel.cpp 3KB
crypto.cpp 3KB
udp_channel.cpp 3KB
ts_peer.cpp 2KB
datagram.cpp 2KB
multiplexor_impl.cpp 2KB
ghost.cpp 2KB
udp_channel_sm.cpp 2KB
common_handler.cpp 2KB
accept_handler.cpp 2KB
app.cpp 2KB
udp_session_mgr.cpp 2KB
address.cpp 2KB
obj_mgr.cpp 2KB
udp_session.cpp 2KB
tcp_channel_sm.cpp 1KB
user_mgr.cpp 1KB
sink.cpp 1KB
app.cpp 1KB
channel_sm.cpp 1KB
path_sm.cpp 1KB
udp_path.cpp 1KB
app.cpp 1KB
thread.cpp 907B
tcp_path.cpp 890B
keep_alive.cpp 737B
log.cpp 657B
msg_parser.cpp 615B
exception.cpp 568B
reportor.cpp 424B
lock.cpp 264B
stdafx.cpp 198B
Makefile.FreeBSD 3KB
log.h 20KB
msg_encoder.h 9KB
framework.h 9KB
msg_decoder.h 7KB
obj_mgr.h 7KB
stream.h 4KB
msg_dispatcher.h 3KB
p2p.h 3KB
p2p_msg_def.h 3KB
socket_base.h 3KB
msg_base.h 3KB
udp_peer.h 3KB
tcp_session.h 3KB
stdafx.h 3KB
network.h 3KB
buffer.h 3KB
lock.h 3KB
multiplexor.h 2KB
path.h 2KB
hash_table.h 2KB
event_handler.h 2KB
address.h 2KB
misc.h 2KB
dispatcher.h 2KB
datagram.h 2KB
types.h 2KB
multiplexor_impl.h 2KB
tc_peer.h 2KB
udp_channel.h 1KB
ts_peer.h 1KB
ghost_dlg.h 1KB
multiplexor_impl.h 1KB
resource.h 1KB
udp_session.h 1KB
channel.h 1KB
udp_session_mgr.h 1KB
user.h 1KB
socket_def.h 1KB
共 158 条
- 1
- 2
资源评论
- zxxhonest2014-08-17根本不好使,浪费我的分
- zhangx5072015-05-18只能用来看看 问题多
- xhdbmm2012-11-20编译出现各种问题。。。
herm_lib
- 粉丝: 172
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功