<script type="text/javascript"> google_ad_client = "pub-8800625213955058"; /* 336x280, 创建于 07-11-21 */ google_ad_slot = "0989131976"; google_ad_width = 336; google_ad_height = 280; // </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
远程客户端相互通讯的实现
Client1通过与SocketServer通讯,可得知其IP地址Client1IP,Client2也通过与SocketServer通讯,也可得知其IP地址Client2IP。两个IP地址可存放地址列表里。每个Client建立两个UDP和利用两个端口,一个用来发送数据给另一个Client,一个用来接收从另一个Client的数据。SocketServer将Client2IP发给Client1,这样Client1用SendUDP向Client2IP发送数据,Client2用recievedUDP接收数据。反之,也行。