Skip to main content

Associate a peer with a pipe (Communicate with a peer with just its peerID)

5 replies [Last post]
albertogs
Offline
Joined: 2008-03-11

I have tried to associate, somehow, a peer with the pipes that peer announces. But I didn't find the way.

I am trying to get connected to a peer just knowing its peerID, and from it, get one of its pipes (a PipeAdvertisement) so I can contact with that peer. But I didn't find a native method to know who is the owner or the original sender of a pipe advertisement, so I can't communicate with a peer just knowing its peerID.

Any idea?

Thanks in advance,
Alberto.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
bondolo
Offline
Joined: 2003-06-11

When using pipes it normally should not matter what peer is connected to a pipe.

Communication with a specific peer is possible using the EndpointService as you mention in other posts.

What is your application trying to do that it needs to know what peer is using a specific pipe?

Mike

albertogs
Offline
Joined: 2008-03-11

Thank you two for the answers.

In the application I am writing, the peers I need to contact to need to be specifics peers. My application uses the notion of Semantic Overlay Networks in order to be able to recommend contents to other peers. The way to do this is getting semantic profiles for concrete users and, that users, recommend in turn other users with content semantically similar to our preferences. So from a concrete peer id (no matter how is it identified, but must be always the same way) I need to be able to contact it. Usually the peer id is shared from a different peer.

felbinac
Offline
Joined: 2008-10-02

Hi.
How about if you try to associate the peerID as a meta-data with the PipeAdvertisement by using PipeAdvertisement.setDesc() method, I propose, but I have not yet...

To do so, however, you need make the ID a child element of an object derived from net.jxta.document.StructuredDocument. And you can put the object with the ID into the PipeAdvertisement.

As a result, a peer receiving the PipeAdvertisement can retrieve the peerID of the original sender by using PipeAdvertisement.getDesc() method.

Bad idea?

albertogs
Offline
Joined: 2008-03-11

Hi again.

Thank you for the idea. Actually, I had though (kind of) about it. But, from my point of view, that should be the way to discover peer. I think the way must be the following:
- You discover peers (using Peer Discovery). That's alright with JXTA as it is.
- You may no need them for a long time, maybe, you just need to know who is in each group.
- When you need to contact a peer, you try to contact it. So, there must be a way to get a Pipe Adv from that peer from the PeerID.

I'm doing some tests, trying to get the EndpointAddress from the PeerID, and transfer the PipeAdv using that EndpointAddress messenger. But anyway, I still that's not the right way to do it.

Do you have a better idea? (well, actually, what I am looking for is a more "natural" idea within the JXTA context).

Regards,
Alberto.

felbinac
Offline
Joined: 2008-10-02

I'm sorry for my misunderstanding.

I think you would have also tried using Resolver Service for your purpose...
If a peer has to send a message to another peer without using Endpoint Service directly, it can do using ResolverService.sendQuery() with the target peer's ID. That's all I could think up. I also have tried using ResolverService to send a message without a pipe, sorry to say, on a LAN inside a NAT. But the Service would be able to use on the Internet.
According to the book I read written by Mr. Brendon Wilson, Endpoint Service can not be used beyond a NAT or a Firewall. In this regard, however, the content might be obsolete already.

Thank you.