Re: Peers do not find each other
Bernard Traversat <[email protected]>
| Newsgroups | gmane.comp.java.jxta.user |
|---|---|
| Message-ID | <[email protected]> |
Poole, Paul P1 wrote: > Matthias, > > In my setup, I do not explicitly set any peer as a rdv, but rather after > a period of about 2 minutes, one of my peers becomes and > AUTO_RENDEZVOUS. I typically wait until the one peer becomes a rdv > before starting up another, so I don't know what will happen if I start > multiple nodes at the same time so that a rdv is not available on > loadup. I suspect that one of them will become a rdv and all will work > fine. Yes, you are correct. This is what will happen as part of the default AUTO_RENDEZVOUS policy. The timeout can be changed for your application. B. > I will test this scenario tomorrow and get back to you. > > I think if you play with your configuration, you should be able to get > it working without explicitly setting a peer to rdv. You might search > the list for the subject "MyJXTA configuration"... There might be > something useful there for you. > > Hth > > Paul > > -----Original Message----- > From: Matthias Horst [mailto:[email protected]] > Sent: Tuesday, August 09, 2005 4:42 PM > To: [email protected] > Subject: Re: [JXTA user] Peers do not find each other > > > Hi friends, > > I searched a little bit more on the mailing list and found out that I > really need to have a rdv service. So I added to my program an explizit > call to start a rendezvous service (the code is below). But still a > second peer (at the same switch) does not find the first peer. > > Btw. the peerGroup I pass over is the global netPeerGroup. > > greetings > > Matthias > > > > public boolean waitForRendezVous(PeerGroup peerGroup) throws > Exception { > RendezVousService rdv = peerGroup.getRendezVousService(); > if (rdv.isRendezVous()) { > return true; > } > if (rdv.isConnectedToRendezVous()) { > return true; > } > > //waiting for rdvs 20secs > int count = 0; > while (!rdv.isConnectedToRendezVous() && !rdv.isRendezVous()) { > Thread.sleep(1 * 1000); > if (++count >= 20) { > break; > } > } > > // expl. start the rdv service > rdv.startRendezVous(); > > // check again > count = 0; > while (!rdv.isConnectedToRendezVous() && !rdv.isRendezVous()) { > Thread.sleep(1 * 1000); > if (++count >= 5) { > break; > } > } > > return rdv.isConnectedToRendezVous(); > } > > > Matthias Horst wrote: > > >>Hi, >> >>Background: >>------------ >>I try to connect two peers, call them peer A and peer B, which are >>plugged in at the same router. I do *not* configure any rendezvous >>peers, because for my projekt a want to give away just a CD with the >>Peer-2-Peer Software and everybody in the same network, who uses the > > CD, > >>should find all the other users automatically, without asking a >>administrator for settings. (At least that's the idea) >> >>Settings: >>----------- >>As a special I set the rendezvous seed peers to something stupid, e.g. >>tcp://127.0.0.1:19999, because if I leave this option empty, it always > > >>tries to connect automatically to the official jxta.org rendezvous > > peers > >>what I don't want. I do *not* enable the option "use only configured >>seed peers" such that it should also look for lokal rendezvous via >>multicast. Btw. TCP and Multicast is enabled. All firewalls are >>disabled. My program waits 20 seconds in order to find a rdvs or to >>become a rdvs by itself (this is made by a piece of code Muhamed >>committed to the mailing list ...) >> >>Experiment: >>------------ >>With these settings peer A and peer B don't find each other. Moreover >>the program does not say that it has become a rdvs by itself. >> >>Now I configure peer A as a rendezvous and restart it without >>restarting >>peer B (the edge peer). >> >>Again they don't find each other. >> >>Now I restart peer B (the edge peer). >> >>Again they don't find each other. >> >>Now I configure peer B to use peer A as a rendezvous (seed rendezvous) >>and restart it without restarting peer A. >> >>Now everything works fine! >> >>Then I stop peer A (the rendezvous) and restart it. >> >>Again they don't find each other. >> >>Question: >>------------ >>Is anybody out there who can explain this behaviour? I thought that at >>least in the same subnet all peers find each other automatically as > > long > >>as multicast is enabled even without an explicit rdv peer. Obviously > > as > >>soon as peer A is offline for some seconds every communication between > > A > >>and B seems to be impossible. I don't think that you guys out there > > are > >>using a p2p network where everybody must reboot his application > > because > >>somebody else shutdown his peer ;) So what's the trick? >> >> >> >>greetings >> >> >> >>--------------------------------------------------------------------- >>To unsubscribe, e-mail: [email protected] >>For additional commands, e-mail: [email protected] > > > -- --http://weblogs.java.net/blog/tra "As Java implies platform independence, and XML implies language independence, JXTA implies network independence."