有4种NAT类型:
- Full cone NAT
- (Address) restrict cone NAT
- Port restrict cone NAT
- Symmetric NAT
打洞穿网需要两台Server:
- 信令Server,帮助客户机沟通IP:Port
- STUN Server,客户机判断自己所在NAT类型
STUN Server判断NAT类型步骤,参考下面链接:
UDP-P2P打洞穿网步骤,参考下面链接:
http://www.blogjava.net/linli/archive/2014/10/23/418968.html