I have a problem with jxta. I dont get peer list.
@Override public void discoveryEvent(DiscoveryEvent event) {
DiscoveryResponseMsg res = event.getResponse();
Enumeration en = res.getAdvertisements();
if (en != null) {
while (en.hasMoreElements()) {
PeerAdvertisement a = (PeerAdvertisement)en.nextElement();
Console.append(a.name()+"\n");
}
}
and
discovery.getRemoteAdvertisements(null, DiscoveryService.PEER, null, null, 1, null);
Console.append - is append to JTextArea. In this console print only one peer, but jxtanetwork have 3 peers. Where is error? P.S. I get code from How do I discover peers and send messages in JXTA-JXSE 2.6? P.P.S Sorry for my bad english.. I'm hope for your help... Thanks
1is the issue, it is the maximum number of answers your will get back (1 is less than 3).