Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can a peer find another peer?

There is an important issue that is not clear when someone search information about how the peers find each other in JXTA. Let´s assume that we have got two peers one in Berlin and the another one in London, which is a rendezvous. My question is how can the peer in Berlin find the peer in London?

  1. What methods in JXTA to solve this ?
  2. Can you post an example?
like image 852
Alex Avatar asked Nov 04 '22 01:11

Alex


2 Answers

Googling jxta Peer Discovery Protocol we find http://java.sun.com/developer/Books/networking/Wilson/wilson_ch04.pdf.

like image 108
Zecas Avatar answered Nov 09 '22 08:11

Zecas


You need to know the URI of a public Rendezvous peer which is a pre-existing Peer visible to both your peer in London and Berlin. When you start your peers, you seed the NetworkConfigurator with this rendezvous peer's URI, something like this:

NetworkManager manager = new NetworkManager(...)
NetworkConfigurator config = manager.getConfigurator();
config.addRdvSeedingURI("tcp://123.123.123.123:1234");

I think @JVerstry says something similar here: https://stackoverflow.com/a/4953034/1240660

like image 30
yeeking Avatar answered Nov 09 '22 08:11

yeeking