⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 subject_21228.htm

📁 一些关于vc的问答
💻 HTM
📖 第 1 页 / 共 4 页
字号:
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:dothink 回复日期:2003-05-12 12:52:32
<br>内容:怎么没有人继续讨论了?
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:beetle 回复日期:2003-05-14 01:54:25
<br>内容:一共有6种网关类型,有几种是可以互通,有几种不行。<BR>只要你们知道网关的原理就知道该怎么连接了,<BR>一定要有个服务器帮助才行。<BR><BR>我曾经写过一个:<BR>http://hp.xilu.com/~maomao/AI/p2p/Xp2p.zip<BR><BR>我还有测试网关类型的代码,说明。
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:dothink 回复日期:2003-05-15 20:43:58
<br>内容:能否发我一份,在此先谢了,dothink@sohu.com
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:huyi 回复日期:2003-05-21 22:36:33
<br>内容:还没完呢,继续啊
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:111 回复日期:2003-05-22 13:29:37
<br>内容:条件:a机器通过A连Internet,b机器通过B连Internet,C是QQ服务器<BR>1、a机器上QQ,C就知道了A的PORT,C通过A的PORT把数据包发给a。(A的转发功能)<BR>2、b机器上QQ,C就知道了B的PORT,C通过B的PORT把数据包发给b。(B的转发功能)<BR>3、a和b通讯,C把B的PORT告诉a。<BR>4、a把包发给B的PORT,由B转发给b。如果失败,则发给C,再由C发给b。<BR><BR>我认为是这样的。
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:黄鸭叫 回复日期:2003-05-22 14:43:55
<br>内容:俺近来也开始研究这个问题,谢谢楼上各位的讨论给我很大的启发,但还有一些问题想请教:<BR>1.正如楼主redspider说,俺对网关和代理也不能很好区分,哪位能指点吗?<BR>2.如果用程序的话,UDP怎么得到对方的IP和Port呢?
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:黄鸭叫 回复日期:2003-05-26 14:40:51
<br>内容:下面的资料是从一个网站上找到的。从中拷了一段重要的贴上来<BR>2.3.1. Clients Behind Different NATs<BR><BR>&nbsp;&nbsp; Suppose clients A and B both have private IP addresses and lie behind<BR>&nbsp;&nbsp; different network address translators.&nbsp;&nbsp;The peer-to-peer application<BR>&nbsp;&nbsp; running on clients A and B and on server S each use UDP port 1234.&nbsp;&nbsp;A<BR>&nbsp;&nbsp; and B have each initiated UDP communication sessions with server S,<BR>&nbsp;&nbsp; causing NAT A to assign its own public UDP port 62000 for A's session<BR>&nbsp;&nbsp; with S, and causing NAT B to assign its port 31000 to B's session<BR>&nbsp;&nbsp; with S, respectively.<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Server S<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Client A&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Client B<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;10.0.0.1:1234&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 10.1.1.3:1234<BR><BR>&nbsp;&nbsp; Now suppose that client A wants to establish a UDP communication<BR>&nbsp;&nbsp; session directly with client B.&nbsp;&nbsp;If A simply starts sending UDP<BR>&nbsp;&nbsp; requests to B's public address, 138.76.29.7:31000, then NAT B will<BR>&nbsp;&nbsp; typically discard these incoming messages because the source address<BR>&nbsp;&nbsp; and port number does not match those of S, with which the original<BR>&nbsp;&nbsp; outgoing session was established.&nbsp;&nbsp;Similarly, if B simply starts<BR>&nbsp;&nbsp; sending UDP requests to A's public address, then NAT A will discard<BR>&nbsp;&nbsp; these messages.<BR><BR>&nbsp;&nbsp; Suppose A starts sending UDP requests to B's public address, however,<BR>&nbsp;&nbsp; and simultaneously relays a request through server S to B, asking B<BR>&nbsp;&nbsp; to start sending UDP requests to A's public address.&nbsp;&nbsp;A's outgoing<BR>&nbsp;&nbsp; messages directed to B's public address (138.76.29.7:31000) will<BR>&nbsp;&nbsp; cause NAT A to open up a new communication session between A's<BR>&nbsp;&nbsp; private address and B's public address.&nbsp;&nbsp;At the same time, B's<BR>&nbsp;&nbsp; messages to A's public address (155.99.25.11:62000) will cause NAT B<BR>&nbsp;&nbsp; to open up a new communication session between B's private address<BR>&nbsp;&nbsp; and A's public address.&nbsp;&nbsp;Once the new UDP sessions have been opened<BR>&nbsp;&nbsp; up in each direction, client A and B can communicate with each other<BR>&nbsp;&nbsp; directly without further reference to or burden on the "introduction"<BR>&nbsp;&nbsp; server S.<BR><BR>&nbsp;&nbsp; The UDP hole punching technique has several useful properties.&nbsp;&nbsp;Once<BR>&nbsp;&nbsp; a direct peer-to-peer UDP connection has been established between two<BR>&nbsp;&nbsp; NATted clients, either party on that connection can in turn take over<BR>&nbsp;&nbsp; the role of "introducer" and help the other party establish peer-to-<BR>&nbsp;&nbsp; peer connections with additional peers, minimizing the load on the<BR>&nbsp;&nbsp; initial introduction server S.&nbsp;&nbsp;The application does not need to<BR>&nbsp;&nbsp; attempt to detect explicitly what kind of NAT it is behind, if any<BR>&nbsp;&nbsp; [STUN], since the procedure above will establish peer-to-peer<BR>&nbsp;&nbsp; communication channels equally well if either or both clients do not<BR>&nbsp;&nbsp; happen to be behind a NAT.&nbsp;&nbsp;The hole punching technique even works<BR>&nbsp;&nbsp; automatically under "Twice NAT", where one or both clients are<BR>&nbsp;&nbsp; removed from the public Internet via two or more levels of address<BR>&nbsp;&nbsp; translation.
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:黄鸭叫 回复日期:2003-05-29 13:13:33
<br>内容:谢谢楼上各位的思路,俺也实现了广州和浙江的UDP通讯,^_^。
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:dothink 回复日期:2003-06-02 14:21:14
<br>内容:to ki_xiao<BR>:能说一说怎么实现的吗,可有示例代码一看?
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:dothink 回复日期:2003-06-02 14:21:57
<br>内容:to ki_xiao<BR>:能说一说怎么实现的吗,可有示例代码一看?若能发一份万分感谢,dothink@sohu.com.
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:黄鸭叫 回复日期:2003-06-03 09:12:39
<br>内容:to ttkttkttk:<BR>&nbsp;&nbsp;&nbsp;&nbsp;NAT是透明的,简单的说就是你发送出外网的时候可以当它不存在,但是服务端要记得保存下它对外的IP和端口,然后发进来的时候发给这个地址就可以了。其中还有这个通讯的保持、严格NAT的考虑什么的也要注意一下。<BR>&nbsp;&nbsp;&nbsp;&nbsp;代码是公司的,不好给你,等我忙完了再写一个简单的通讯。希望前面的达人们都回来讨论一下啊&nbsp;&nbsp;^_^
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:雪无颜 回复日期:2003-06-25 19:48:17
<br>内容:那么请问NAT代理ICMP报文是如何实现转交的呢???
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:黄鸭叫 回复日期:2003-06-26 09:07:39
<br>内容:应该机制是差不多的,只是我想可能有一些要设置的。大家来讨论一下啊。<BR><BR>楼上的准备做什么?
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:雪无颜 回复日期:2003-06-28 20:28:07
<br>内容:呵呵ICMP是没有端口的,那么在NAT代理里面是怎么对应的呢?<BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:清水堰 回复日期:2003-07-23 21:53:44
<br>内容:大家都好厉害,我的水平和你们差得太远了.
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:小乔 回复日期:2003-09-12 16:04:52
<br>内容:勉勉强强能看懂,可是有两篇E文看不懂。谁帮小第一把翻译一下!<BR>你们的讨论实在是精彩!<BR>狂顶!!!!
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -