Re: Individual Members of PeerGroup
Mohamed Abdelaziz <[email protected]> Mon, 12 Sep 2005 12:54:47 -0700
| Newsgroups | gmane.comp.java.jxta.user |
|---|---|
| Message-ID | <[email protected]> |
PipeMessage should define and include source PID, IMO is it a missing
feature. However, in the interim. Exchange src id in the message, and to
convert a string into a peerid can be easily done through :
try {
pid =(PeerID) IDFactory.fromURI(new URI(pidStr));
} catch (Exception ex) {}
The problem with using the list of peers connected to a rendezvous, is
the assumption that such peers are subscribers to the communication
channel, in addition, the pipe service does not expose any api's to
access the list of subscribers. That said, the simplest way to do this
without extending the core services is to use a dynamic list.
I would also add the dynamic list should be an LRU cache to ensure a
fresh list (the JXME project has a class which fits this purpose see:
http://jxme.jxta.org/source/browse/jxme/proxyless/proto/src/net/jxta/impl/cm/LRUCache.java?rev=1.2&view=auto&content-type=text/vnd.viewcvs-markup).
Mohamed
--
http://blogs.sun.com/roller/page/hamada
http://weblogs.java.net/blog/hamada
Poole, Paul P1 wrote:
>Ok... So, I have implemented my recovery thread according to our
>conversation. Of course, now I have a different problem :-)
>
>On the rendezvous, I can do the following to get a Vector of peers (IDs)
>currently connected to the rdv:
>pg.getRendezVousService().getConnectedPeerIDs();
>
>However, from an edge peer, this returns an empty vector (looking at the
>service implementation for an edge peer, I can see why). Mohamed, in
>one of your earlier replies, you had recommended that I "keep track of
>peers over the course of communication and dynamically augment the
>random set of peers" -- My problem here is that as each message is
>received, I have no way of identifying the sender unless I tag the
>message with a message element identifying the sender (which I do this).
>The problem here is that the tag provides me with a String of the
>PeerID, but I need the PeerID object to call
>pipeSerivce.createOutputPipe()... Is there some other way to identify
>the sender? Also, although a communication history could work, I am a
>little afraid of creating a stale list (due to high churn rate)... So,
>my preference is a solution whereby I can obtain the latest list of
>connected peers. Is there another route for this (for the edge peers)?
>
>
>I apologize for all the questions, but I can't seem to find the answers
>elsewhere...
>
>Thanks,
>
>Paul
>
>-----Original Message-----
>From: Mohamed Abdelaziz [mailto:[email protected]]
>Sent: Monday, September 12, 2005 11:25 AM
>To: [email protected]
>Subject: Re: [JXTA user] Individual Members of PeerGroup
>
>
>Creating a propagate output pipe has very little cost associated with
>it. I suggest creating a new one when needed, then discarding it.
>
>