简体   繁体   English

P2P java文件传输

[英]P2P java file transfer

First off, I am VERY new to Java, but wanted to know if it was possible. 首先,我对Java非常陌生,但想知道它是否可行。 I could not find any tutorials or explanation online: 我在网上找不到任何教程或解释:

Is it possible to send/receive files not through a server, but P2P. 是否可以不通过服务器发送/接收文件,而是P2P。 I want a file, when selected, to be sent to another PC running the client. 我想要一个文件,当被选中时,被发送到运行客户端的另一台PC。 What is the best method of doing this? 这样做的最佳方法是什么? Is there something I have missed? 有没有我错过的东西?

(Ps My first stackoverflow question, please be nice :D) (Ps我的第一个stackoverflow问题,请很好:D)

Give JXTA a try, it should satisfy all your needs. 试试JXTA ,它应该满足您的所有需求。

Or try a DHT implementation for the P2P part and implement the file transfer either over the DHT or just the sesssion initiation by DHT and some other kind of direct file transfer. 或者尝试用于P2P部分的DHT实现,并通过DHT或仅通过DHT启动sesssion以及其他一些直接文件传输来实现文件传输。

(DHT selection taken from this question ) (从这个问题中选择DHT)

Pastry provides a DHT. 糕点提供DHT。 Its done Java and very easy to use. 它完成了Java并且非常易于使用。 Its storage system is known as PAST and a tutorial can be found here : https://trac.freepastry.org/wiki/tut_past 它的存储系统称为PAST,可在此处找到教程: https//trac.freepastry.org/wiki/tut_past

I've had a great experience working with it. 我有一个很好的使用经验。

Maybe you want to have a look at http://www.adp-gmbh.ch/blog/2004/november/15.html 也许你想看看http://www.adp-gmbh.ch/blog/2004/november/15.html

Every Peer in a P2P-system will have both roles (receiver AND sender that is each peer is server AND client at the same time). P2P系统中的每个Peer都将具有两种角色(接收者和发送者,即每个对等体同时是服务器和客户端)。

It is certainly possible. 这当然是可能的。 Check the Free Pastry implementation 检查Free Pastry实现

JXTA are a little complex to someone new in Java and it has some limitations with scalability and perfomance of his communications layers. JXTA对于Java新手来说有点复杂,并且在通信层的可扩展性和性能方面存在一些局限性。 Another option is XMPP , if a pure P2P is not mandatory. 另一个选择是XMPP ,如果纯P2P不是强制性的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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