RE: Building PipeAdvertising
"Chris Audley" <[email protected]> Tue, 30 May 2006 14:21:07 -0400
| Newsgroups | gmane.comp.java.jxta.user |
|---|---|
| Message-ID | <[email protected]> |
Close but not quite. The important piece of information is the PipeID, and every client needs to generate the same PipeID if they are going to use this pipe to communicate with each other. The variant of IDFactory.newPipeID you chose will generate a randon ID within the scope of the peer group, you want to generate a specific ID within the peer group. To do this, you need to specify a seed for the ID generator. There is a method on IDFactory that will allow you to specify a seed: [newPipeID(PeerGroupID, byte[])]. If you use this method and all clients specify the same seed, then they will all generate the same pipe ID and can talk to each other using the resulting pipe advertisement. For ideas on generating a seed value, see the Wiki entry on "Well Known ID's" http://wiki.java.net/bin/view/Jxta/WellKnownIDs Cheers Chris -----Original Message----- From: Java [mailto:[email protected]] Sent: Tuesday, May 30, 2006 5:11 AM To: [email protected] Subject: [JXTA user] Building PipeAdvertising hello, i have this question: if I build a pipe advertisement using this code: pipeAdv = (PipeAdvertisement)AdvertisementFactory.newAdvertisement( PipeAdvertisement.getAdvertisementType()); pipeAdv.setPipeID(IDFactory.newPipeID(peerGroupName.getPeerGroupID())); pipeAdv.setName(channelName); pipeAdv.setType(PipeService.UnicastType); so, taking informations from the peer group, do I obtain the same pipeAdvertisement in every peer that runs this code? Or in another way: is there any way to "build" the pipeAdvertisment for a group? So every peer can build its copy of the pipe for communicating with other peers. regards Segolas --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]