java - JXTA on internet -
java - JXTA on internet -
i developping jxta based application in java jxse. work locally, seek work on internet.
for exemple, have 2 computers on local network. find each other immediatly, , application work. no problem.
now, have these 2 computers, , 2 others computers on other local network. understand it, need, minimum requierement, 2 public rendezvous peer (one on each local network) connected. can't find how deal it.
in application, utilize setautostart method, that's mean peer promoted rendezvous peer automatically if needed.
so think, it's impossible 2 distant peer find each other without give public adresse. need retrieve valid tcp adress on peer , give others. if know how that, happy !
edit: config
//network setup seek { manager = new networkmanager(networkmanager.configmode.edge, peer_name, conf.touri()); } grab (ioexception e) { //chemin wrong ? e.printstacktrace(); system.exit(-1); } seek { networkconfigurator configurator = manager.getconfigurator(); configurator.settcpport(port); configurator.settcpenabled(true); configurator.settcpincoming(true); configurator.settcpoutgoing(true); configurator.setusemulticast(true); configurator.setpeerid(peer_id); } grab (ioexception e) { // ? si le dossier bien été crée pas trop de raison d'avoir cette exception e.printstacktrace(); } // ..... code ....... /// peergroup net_group = manager.startnetwork(); net_group.getrendezvousservice().setautostart(true);
so create addrendezvous(uri uri) or addrendezvous(string uri) work net_group.getrendezvousservice, don't know how find uri or adress ..
and app :
from experience, can suggest following:
1) ensure port , ip address open , available. if have antivirus, create sure port opened.
2) log messages informative. can post log messages getting ? in log messages: new seeding... jul 31, 2013 6:50:05 pm net.jxta.impl.endpoint.netty.asynchronousnettymessenger connectiondied
3) ensure network manager waits sufficient duration connect rendezvous, before connection times out. shuld create border wait long enough:
boolean connected = networkmanager.waitforrendezvousconnection(20 * 1000);
also, can add together rendezvous server's seeding address border peer's network configuration. here code used:
networkmanager edgepeermanager = new networkmanager(networkmanager.configmode.edge,...); networkconfigurator edgepeerconfigurator = edgepeermanager.getconfigurator(); // rendezvous' ip address , listening port rendezvouservertcpseed = "tcp://192.xxx.x.xx:9705"; edgepeerconfigurator.addrdvseedinguri(rendezvouservertcpseed); peergroup edgepeergroup= edgepeermanager.startnetwork();
in rendezvous server, if connection successful, message @ console saying:
info: line 145 net.jxta.impl.endpoint.netty.nettytransportclient.getmessenger() processing request open connection tcp://192.xxx.x.xx:9705 net.jxta.impl.endpoint.netty.nettytransportclient getmessenger info: succeeded in connecting tcp://192.xxx.x.xx:9705, remote peer has logical address jxta://cbid-5961xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
do allow me know, if have solution problem.
thanks dd
java desktop-application p2p jxta
Comments
Post a Comment