使用Java的对等应用程序 [英] Peer-to-Peer application using java

查看:84
本文介绍了使用Java的对等应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Java和Netbeans IDE开发一个p2p应用程序.在我的应用中,我想做两件事

I want to develop a p2p app using java and netbeans IDE. In my app i want to make two things

  • 用户之间的文件共享
  • 用户之间的聊天 我从不同的资源中读到了
  • file sharing between users
  • Chat between users I have read from different resources

对等对象简介-Peer Sockets Project

问题是我如何能够将两台或更多台PC连接到不同的网络.显示所有连接的对等方,大小限制下的任何类型的文件共享.任何帮助将不胜感激.

Problem is how i am able to connect two or more pcs connected to different networks. Showing all connected peers, file sharing of any type under a size limit. Any help will be appreciated.

推荐答案

这些问题涉及最著名的NAT遍历问题,与NAT遍历无关的语言与您所使用的语言无关,而是有关基本语言问题域.首先,您需要使用某种信令方法(例如SIP,叮当..)来广告两端的地址.现在,如果您要连接位于同一网络或NAT后面的两个端点,则只需知道或通告本地主机候选者就可以完成工作,但是如果您的任何端点位于网络之外或在两个端点之间具有NAT,那么您需要使用诸如STUN/TURN/ICE之类的协议遍历NAT.根据您的用例,您可能有兴趣阅读RFC-5389,RFC-5245和RFC-5766等RFC.一旦知道了您的需求,您可能会得到google的任何开源解决方案,或者如果您好奇的话,可以开始基于RFC实施解决方案.因此,诸如NAT遍历或STUN/TURN/ICE之类的关键字可能会帮助您首先了解您的问题,一旦知道了问题域,便可以找到解决方案.

These questions are dealing with the most well known problem of NAT traversal, dealing with the NAT traversal is not related with the language you are using rather its about the basic problem domain. First of all you need to advertise the address(es) of your both end using some signalling method (i.e. SIP, Jingle ..). Now if you are trying to connect two end point which resides behind same network or NAT then simply knowing or advertising the local host candidates will do the job, but if any of your end point resides out side of the network or having NAT between two endpoints then you need to traverse the NAT using protocols like STUN/TURN/ICE. Based on your use cases, you may interested to read the RFCs like RFC-5389, RFC-5245 and RFC-5766. Once you know what you need you might get any open source solution by google, or If you are curious enough you may start implementing your solution based on the RFCs. So the keywords like NAT traversal or STUN/TURN/ICE might help you to know your problem first, once you know your problem domain then you can find solution.

这篇关于使用Java的对等应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆