I am developping a JXTA based application in Java with JXSE. It work very well locally, but now i try to get this work on internet.
For exemple, i have 2 computers on a local network. They will find each other immediatly, and the application will work. No problem.
Now, i have these 2 computers, and 2 others computers on an other local network. As i understand it, i need, for minimum requierement, 2 public RendezVous peer (one on each local network) that will be connected. But i can't find how to deal with it.
In my application, i use the setAutoStart method, that's mean the peer will be promoted to a RendezVous peer automatically if needed.
So i think, it's impossible for 2 distant peer to discover each other without give then their public adresse. So i need to retrieve a valid tcp adress on a peer and give it to the others. If someone know how to do that, i will be very happy !
Edit: my config
//Network setup
try {
manager = new NetworkManager(NetworkManager.ConfigMode.EDGE, peer_name, conf.toURI());
} catch (IOException e) {
//chemin incorrect ?
e.printStackTrace();
System.exit(-1);
}
try {
NetworkConfigurator configurator = manager.getConfigurator();
configurator.setTcpPort(port);
configurator.setTcpEnabled(true);
configurator.setTcpIncoming(true);
configurator.setTcpOutgoing(true);
configurator.setUseMulticast(true);
configurator.setPeerID(peer_id);
} catch (IOException e) {
// ? Si le dossier a bien été crée pas trop de raison d'avoir cette exception
e.printStackTrace();
}
// ..... some code ....... ///
PeerGroup net_group = manager.startNetwork();
net_group.getRendezVousService().setAutoStart(true);
So i would create a addRendezVous(URI uri) or addRendezVous(String uri) that work with net_group.getRendezVousService, but i don't really know how to find the URI or adress ..
And my app :