4

First off, I am VERY new to Java, but wanted to know if it was possible. I could not find any tutorials or explanation online:

Is it possible to send/receive files not through a server, but P2P. I want a file, when selected, to be sent to another PC running the client. What is the best method of doing this? Is there something I have missed?

(P.s. My first stackoverflow question, please be nice :D)

2
  • Sure, it's possible. But generally firewalls make it difficult/impossible to do so, especially if either client is behind a NAT gateway.
    – Marc B
    Sep 8, 2011 at 17:57
  • Search here on SO for P2P + Java. There are a lot of questions and answers already.
    – Perception
    Sep 8, 2011 at 17:58

5 Answers 5

3

Give JXTA a try, it should satisfy all your needs.

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.

(DHT selection taken from this question)

2
0

Maybe you want to have a look at 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).

0

It is certainly possible. Check the Free Pastry implementation

0

JXTA are a little complex to someone new in Java and it has some limitations with scalability and perfomance of his communications layers. Another option is XMPP, if a pure P2P is not mandatory.

0

Pastry provides a DHT. Its done Java and very easy to use. Its storage system is known as PAST and a tutorial can be found here : https://trac.freepastry.org/wiki/tut_past

I've had a great experience working with it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.