Peer Discovery Protocol (PDP) for the Jxta Core Protocol (III)

Source: Internet
Author: User
!--google_ad_client = "pub-2947489232296736";/* 728x15, created in 08-4-23msdn/Google_ad_slot = "362 4277373 "; Google_ad_width = 728; Google_ad_height = 15; -->
!--google_ad_client = "pub-2947489232296736";/* 160x600, created in 08-4-23msdn/Google_ad_slot = "4367022601" ; Google_ad_width = 160; Google_ad_height = 600; --> or first use an example to explain it! :) This example shows how to discover other JXTA peers on the network. One . Application instance Source Code:DiscoveryDemo.java  1   Import java.util.enumeration;2   Import net. jxta.discovery.*;3   Import Net. jxta.exception.*;4   Import Net. jxta.peergroup.*;5   Import Net. jxta.protocol.*;6   7   public class Discoverydemo implements Runnable, Discoverylistener {8    9      static Peergroup Netpeergroup = null;10      Private Discoveryservice discovery;11  12     //Start configuration Jxta platform 13      private void Startjxta () {14          try {15               Netpeergroup = Peergroupfactory.newnetpeergroup ();16          }catch (peergroupexception e) {17  18              //If you cannot instantiate peer Group, export the reason and end the program. 19              System.out.println ("Fatal Error:group creation Failure"); 20               e.printstacktrace ();21               system.exit (1);22          }2324     //server found from peer group 25  &n

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.