简体   繁体   中英

Peer-to-Peer application using java

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

Introduction to the Peer-to-Peer Sockets Project

Peer-to-Peer File Sharing

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.

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 (ie 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.

现在,如果您尝试连接位于同一网络或 NAT 后面的两个端点,那么只需知道或通告本地主机候选人即可完成这项工作,但如果您的任何端点位于网络外部或在两个端点之间具有 NAT那么你需要使用像 STUN/TURN/ICE 这样的协议来遍历 NAT。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM