Re: Peer-Discovery in own Group

Yun Ding <[email protected]>
Newsgroups gmane.comp.java.jxta.user
Message-ID <[email protected]>
Hi,

> thank you very much for that explanation. Now I tried this:
>
>dhtPeerGoup.getRendezVousService().setAutoStart(true);
>rdv = dhtPeerGoup.getRendezVousService();
>  
>while (!rdv.isConnectedToRendezVous()) {
>    try {
> Thread.sleep(2000);
>    } catch (InterruptedException e1) {
>}
>
>But I never get out of the loop. When there is just one instance of my 
>Application. So there ist just one member in this group - me. So I 
>should become rendezvous-peer of this group, don't I?
>  
>
yes, you are right.  Your peer will become the rendezvous peer, and it 
is not
connected to itself (sounds strange).  You should use the following code.
Your peer will get out of the loop, since it itself becomes a rendezvous 
peer.

        while (( ! rdv.isConnectedToRendezVous () ) &&
           ( ! rdv.isRendezVous ()   ) )  {
              try {
                   Thread.sleep ( 2000  );
              }
          catch ( Exception e ) {}
        }
 
Best wishes,

Yun


-- 
Yun Ding
European Media Laboratory GmbH
Schloss-Wolfsbrunnenweg 33
D-69118 Heidelberg
Tel.: (+49) 6221 533 240
Fax.: (+49) 6221 533 298
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.