Jxta
Posted: Mon May 09, 2005 12:21 pm
Tech discussion, website creation and the world's best OT Forum!
https://forums.cricketmx.com/
I don't think that's what you think it is. As I understand it, p2p clients 'advertise' themselves in order to find other clients and servers. This is the way that networks form. There'd be absolutely no point in an open source project containing ad-ware. Any developer that fancied doing so would just take the stuff out - end of problem. And anyway - who would benefit?tunebud wrote:I seen its main source of hookup is advertisememnts
Code: Select all
{
//We will create a new group based on the netPeerGroup so let's copy its
//impl advertisement and modify it.
ModuleImplAdvertisement implAdv =
netPeerGroup.getAllPurposePeerGroupImplAdvertisement();
myPeerGroup = netPeerGroup.newGroup(
null, //Create a new group id for this group.
implAdv, //Use the above advertisement.
"Group name", //This is the name of the group.
"Group description" //This is the description of the group.
);
System.out.println("---Peer group created successfully, id: " +
myPeerGroup.getPeerGroupAdvertisement().getID() );
//Now that the group is created, it is automatically published and stored locally,
//but we need to publish it remotely so other peers can discover it.
discoveryService.remotePublish( myPeerGroup.getPeerGroupAdvertisement() );
System.out.println("---Published peer group advertisement remotely");
}
catch (Exception e)
{
System.out.println("An error occurred");
e.printStackTrace();
}
The call to newGroup() creates and publishes the group to the local cache. Most likely, you will want to publish this advertisement to other peers when you create it, which you can do by calling remotePublish(). This method will push the peer group advertisement to other peers. If you need to make sure that you send the advertisement to peers on another subnet, you must ensure you are connected to a rendezvous peer.