亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? hungrypeer.java

?? p2p 源代碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
import java.io.*;import java.util.Enumeration;import java.util.Vector;import java.net.URL;import net.jxta.peergroup.PeerGroup;import net.jxta.peergroup.PeerGroupFactory;import net.jxta.exception.PeerGroupException;import net.jxta.exception.ServiceNotFoundException;import net.jxta.document.AdvertisementFactory;import net.jxta.document.Advertisement;import net.jxta.document.StructuredDocument;import net.jxta.document.Element;import net.jxta.document.TextElement;import net.jxta.document.StructuredDocumentFactory;import net.jxta.document.MimeMediaType;import net.jxta.discovery.DiscoveryService;import net.jxta.pipe.PipeService;import net.jxta.pipe.InputPipe;import net.jxta.pipe.PipeID;import net.jxta.pipe.OutputPipe;import net.jxta.endpoint.Message;import net.jxta.protocol.PipeAdvertisement;import net.jxta.protocol.PeerGroupAdvertisement;import net.jxta.protocol.ModuleSpecAdvertisement;import net.jxta.protocol.ModuleImplAdvertisement;import net.jxta.id.IDFactory;import net.jxta.id.ID;import net.jxta.platform.ModuleClassID;import net.jxta.platform.ModuleSpecID;// The HungryPeer is joining the RestoNet PeerGroup and searching// for RestoPeers. The HungryPeer is establishing a pipe connection// with all the RestoPeers that it has discovered. The Hungry peer// sends auction requests for French fries to RestoPeers and// then wait for auction bids from RestoPeerspublic class HungryPeer {    private PeerGroup netpg = null;     // NetPeergroup    private PeerGroup restoNet = null;  // Resto Peergroup    private DiscoveryService disco;            // Discovery Service    private PipeService pipes;                 // Pipe Service    private PipeAdvertisement myAdv;    // Hungry peer pipe advertisement    private InputPipe myPipe;           // Input pipe to talk to hungry peer    private MimeMediaType mimeType = new MimeMediaType("text", "xml"); // mime-type    private int timeout = 3000;         // Discovery timeout    private int rtimeout = 30000;       // Pipe Resolver Timeout    private PeerGroupAdvertisement adv; //RestoNet Peergroup advertisement    private Vector restoPeerAdvs = new Vector(); //  RestoPeers adv found    private Vector restoPeerPipes = new Vector(); //  PestoPeers Pipe connection    private String myIdentity = "Bill Joy";  // Identity of this HungryPeer    private String friesRequest ="medium";   // Fries Auction request    // Hungry Peer Main method to start our HungryPeer    public static void main(String args[]) {        HungryPeer myapp = new HungryPeer();        myapp.startJxta();        System.exit(0);    }    public void HungryPeer() { }    // method to start the JXTA platform and our    // HungryPeer    private void startJxta() {        try {            // create, and Start the default jxta NetPeerGroup            netpg = PeerGroupFactory.newNetPeerGroup();        } catch (PeerGroupException e) {            // could not instanciate the NetPeerGroup            System.out.println("Fatal error : creating the NetPeerGroup");            System.exit(1);        }        // Discover and Join the RestoNet Peergroup        joinRestoNet();        //Set our HungryPeer communication pipe so RestoPeers        //can talk to us        if (!setHungryPeerPipe()) {            System.out.println(               "Aborting due to failure to create our HungryPeer pipe");            return;        }        //Attempt to locate RestoPeers in RestoNet        discoverRestoServices();        // Connect to RestoPeers that have been discovered        connectToRestoPeers();        // I am hungry send an auction request for French Fries        // to the RestoPeers I have connected to        sendFriesAuctionRequests();        //Process incoming bids from RestoPeers        receiveFriesBids();    }    // This method is used to attempt to discover the RestoNet    // Peergroup in the current NetPeerGroup. If found the peer join    // the RestoNet peergroup    private boolean joinRestoNet() {        int count = 3; // number of tries to search for the peergroup        System.out.println("Attempting to discover the RestoNet Peergroup");        // get the Discovery service handle from the NetPeerGroup pointer        DiscoveryService hdisco = netpg.getDiscoveryService();        Enumeration ae = null;        // loop until we found the "RestoNet" Peergroup advertisement            while (count-->0) {            try {                // Check if we have the advertisement in the local                // peer cache                ae = hdisco.getLocalAdvertisements(DiscoveryService.GROUP                                                   , "Name"                                                   , "RestoNet");                // check if we got the advertisement, if we got                // it we can exit the loop. Not necessary to go                // further                if ((ae != null) && ae.hasMoreElements()) break;                // The "RestoNet" advertisement is not in the local                // cache send a discovery request to search for the advertisement                hdisco.getRemoteAdvertisements(null, DiscoveryService.GROUP,		     "Name", "RestoNet", 1, null);                // wait to give a chance to the discovery                try {                    Thread.sleep(timeout);                } catch (Exception e){                }            } catch (IOException e){                // found nothing!  move on            }        }        // check if we found the RestoNet advertisement        if (ae == null || !ae.hasMoreElements()) {            System.out.println("Sorry could not find the RestoNet Peergroup");            return false;        }        System.out.println("Found the RestoNet PeerGroup Advertisement");        // Get the advertisement        PeerGroupAdvertisement adv =            (PeerGroupAdvertisement) ae.nextElement();        try {            // Call the PeerGroup Factory to instantiate a new            // peergroup instance on that peer            restoNet = netpg.newGroup(adv);            // get the Discovery and Pipe Service to            // be used within the RestoNet Peergroup            disco = restoNet.getDiscoveryService();            pipes = restoNet.getPipeService();        } catch (Exception e) {            System.out.println("Could not create RestoPeerGroup");            return false;        }        System.out.println("The HungryPeer joined the restoNet PeerGroup");        return true;    }    // Create the HungryPeer Communication pipe to receive bid responses    // from RestoPeers. The advertisement of this pipe is sent as part    // of the auction request for RestoPeers to respond.    private boolean setHungryPeerPipe() {        try {            // get the Discovery and Pipe Service to            // be used within the RestoNet Peergroup            disco = restoNet.getDiscoveryService();            pipes = restoNet.getPipeService();            // Create a pipe advertisement for our hungry peer. This            // pipe will be used within the RestoNet peergroup for other            // peers to talk to our hungry peer            myAdv = (PipeAdvertisement)                AdvertisementFactory.newAdvertisement(                PipeAdvertisement.getAdvertisementType() );            // Initialize the advertisement with unique peer information            // So we can communicate            myAdv.setPipeID(IDFactory.newPipeID(restoNet.getPeerGroupID() ) );            myAdv.setName("restoNet:HungryPipe:" + myIdentity);            myAdv.setType(PipeService.UnicastType);            // Create the input pipe            myPipe = pipes.createInputPipe(myAdv);        } catch (Exception e) {            System.out.println("Could not create the HungryPeer pipe");            return false;        }        return true;    }    // Discover RestoPeers that have joined RestoNet. We discover RestoPeer    // via their published Service advertisement    private void discoverRestoServices() {        int found = 0;                  // Count of RestoPeer found        RestoPeerService restoSrv = null;  // RestoPeer Service Advertisement        System.out.println("Locating RestoPeers in the RestoNet Peergroup");

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美视频三区在线播放| 蓝色福利精品导航| 国产日产欧美一区二区视频| 在线综合视频播放| 欧美日韩一区二区三区视频| 精品视频一区 二区 三区| 欧美亚洲国产一区二区三区va | 国产成人精品免费网站| 国产在线一区二区| 国产精品夜夜嗨| 国产成a人亚洲| 97精品超碰一区二区三区| 日本精品视频一区二区| 欧美午夜精品免费| 欧美一区二区人人喊爽| 精品国产伦一区二区三区观看体验 | 欧美精品vⅰdeose4hd| 4438成人网| 久久亚洲欧美国产精品乐播| 久久精品男人天堂av| 国产精品对白交换视频| 亚洲精品综合在线| 天天av天天翘天天综合网色鬼国产| 日韩高清不卡一区二区| 国产精品一级片| 色域天天综合网| 欧美一区二区在线免费观看| 久久久久国产一区二区三区四区| 中文字幕欧美三区| 亚洲成人av一区二区三区| 精品一二三四在线| 色综合久久综合| 欧美成人精精品一区二区频| 日本一区二区三区高清不卡| 亚洲在线视频一区| 国产精品一区二区在线看| 91国产免费观看| 欧美精品一区二区三区在线播放| 亚洲欧美综合另类在线卡通| 天天影视色香欲综合网老头| 成人一二三区视频| 欧美一区二区三区四区高清| 亚洲天堂av一区| 国产精品综合二区| 日韩一区二区中文字幕| 亚洲三级在线播放| 国产一区不卡在线| 这里是久久伊人| 亚洲欧美日韩国产手机在线 | 午夜激情一区二区三区| 成人妖精视频yjsp地址| 精品国内片67194| 五月天久久比比资源色| 99视频热这里只有精品免费| 欧美精品一区二区三区蜜桃| 婷婷国产v国产偷v亚洲高清| 欧美性猛交xxxxxxxx| 国产精品无码永久免费888| 丝袜美腿一区二区三区| 欧美四级电影在线观看| 1000部国产精品成人观看| 精品一区二区三区的国产在线播放| 欧美三级日本三级少妇99| 1区2区3区国产精品| 国产成人在线色| 国产日韩成人精品| 狠狠色丁香久久婷婷综| 久久影院电视剧免费观看| 玖玖九九国产精品| 欧美本精品男人aⅴ天堂| 美女脱光内衣内裤视频久久网站 | 最新日韩av在线| 懂色av噜噜一区二区三区av| 久久亚洲私人国产精品va媚药| 久草中文综合在线| 91麻豆精品国产91久久久久久久久| 性做久久久久久免费观看欧美| 欧美日韩亚洲丝袜制服| 手机精品视频在线观看| 91精品黄色片免费大全| 奇米影视在线99精品| 日韩区在线观看| 久久99国产精品免费网站| 欧美成人一区二区三区片免费| 国产毛片精品视频| 26uuu欧美日本| 大美女一区二区三区| 国产精品国产自产拍高清av王其| 成人丝袜高跟foot| 亚洲乱码国产乱码精品精小说| 91欧美一区二区| 一区二区三区精品视频在线| 欧美日韩国产高清一区| 日韩黄色在线观看| 久久亚洲一区二区三区明星换脸 | 久久天天做天天爱综合色| 国产高清不卡一区| ㊣最新国产の精品bt伙计久久| 欧美综合亚洲图片综合区| 日本在线不卡一区| 精品国产3级a| 91免费观看视频在线| 亚洲v精品v日韩v欧美v专区| 久久先锋资源网| 色欧美日韩亚洲| 精品一区二区三区视频| 中文字幕一区日韩精品欧美| 欧美日韩三级在线| 国产宾馆实践打屁股91| 亚洲福利视频一区二区| 亚洲精品在线三区| 91丨porny丨国产入口| 强制捆绑调教一区二区| 亚洲三级在线免费观看| 欧美成人乱码一区二区三区| 色婷婷av久久久久久久| 极品少妇xxxx精品少妇| 亚洲欧美视频一区| 亚洲精品一区二区三区香蕉| 91精品办公室少妇高潮对白| 国产福利精品导航| 性欧美疯狂xxxxbbbb| 亚洲欧洲日韩av| 日韩免费观看高清完整版| 色呦呦日韩精品| 国产精品一二三在| 免费在线观看精品| 夜夜揉揉日日人人青青一国产精品| 国产三级欧美三级日产三级99| 欧美日韩激情一区二区三区| 成人av网在线| 国产一区在线观看麻豆| 日韩**一区毛片| 亚洲自拍都市欧美小说| 1024成人网| 亚洲图片你懂的| 国产精品网曝门| 欧美精品一区二区三区在线 | 成人精品一区二区三区四区 | 99久久综合色| 粉嫩蜜臀av国产精品网站| 精品亚洲porn| 免费xxxx性欧美18vr| 视频一区二区国产| 婷婷六月综合亚洲| 亚洲mv在线观看| 亚州成人在线电影| 亚洲一区二区精品视频| 亚洲自拍与偷拍| 一区二区三区视频在线看| 中文字幕亚洲区| 中文字幕一区免费在线观看| 国产精品美女www爽爽爽| 久久久高清一区二区三区| 精品va天堂亚洲国产| 久久影视一区二区| 欧美激情一区二区| 中文字幕不卡在线观看| 中文字幕乱码亚洲精品一区| 欧美高清在线一区二区| 中文字幕 久热精品 视频在线| 久久精品视频一区二区三区| 国产欧美精品国产国产专区 | 久久精品99国产国产精| 免费观看在线色综合| 伦理电影国产精品| 国产一区二区伦理| 国产成人精品免费| 色综合av在线| 在线不卡免费欧美| 精品国产精品一区二区夜夜嗨| 国产婷婷一区二区| 亚洲色欲色欲www| 一区二区免费在线播放| 热久久国产精品| 国产成人av电影在线观看| 91影院在线观看| 91精品国产色综合久久不卡电影| 精品国产乱码久久久久久久久| 国产精品久久三区| 午夜天堂影视香蕉久久| 狠狠色伊人亚洲综合成人| 国产·精品毛片| 欧美日本韩国一区| 中文字幕免费不卡| 亚洲国产视频在线| 国产精品资源网站| 在线精品视频一区二区| 亚洲精品在线网站| 亚洲成人自拍网| 国产福利一区二区三区在线视频| 欧美在线影院一区二区| 欧美成人性战久久| 亚洲精品成人精品456| 韩国欧美国产1区| 欧美视频一区在线观看| 久久精品水蜜桃av综合天堂| 丝袜美腿一区二区三区| 99精品国产99久久久久久白柏| 欧美电视剧免费观看|