Re: Peers do not find each other
Matthias Horst <[email protected]>
| Newsgroups | gmane.comp.java.jxta.user |
|---|---|
| Message-ID | <[email protected]> |
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]
--
================================================================
best regards Genius Bytes
Software Solutions GmbH
Matthias Horst
Dipl. Math. Konrad-Zuse-Str. 16
CTO 44801 Bochum
e-mail: [email protected] fon: +49 234 9708 492
web : http://www.geniusbytes.com fax: +49 234 9708 497
================================================================