java变量对等,使用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

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值