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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? hungrypeer.java

?? p2p 源代碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
import java.io.*;import java.util.Enumeration;import java.util.Vector;import net.jxta.peergroup.PeerGroup;import net.jxta.peergroup.PeerGroupFactory;import net.jxta.exception.PeerGroupException;import net.jxta.document.AdvertisementFactory;import net.jxta.document.Advertisement;import net.jxta.document.StructuredDocument;import net.jxta.document.Element;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.id.IDFactory;// The HungryPeer joins the RestoNet PeerGroup and searches for// RestoPeers. The HungryPeer then establishes a pipe connection to// all the RestoPeers that it discovered. The HungryPeer sends// auction requests for French fries to RestoPeers and then waits for// auction bids from RestoPeerspublic class HungryPeer {    private PeerGroup netpg = null;     // NetPeergroup    private PeerGroup restoNet = null;  // Resto Peergroup    // Services within the RestoNet 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");    private int timeout = 3000;         // Discovery timeout    private int rtimeout = 30000;       // Pipe Resolver Timeout    // All RestoPeers found    private Vector restoPeerAdvs = new Vector();    private Vector restoPeerPipes = new Vector();    private String myIdentity = "Bill Joy";  // Identity of this HungryPeer    private String friesRequest ="medium";   // Fries Auction request    public static void main(String args[]) {        HungryPeer myapp = new HungryPeer();        myapp.startJxta();        System.exit(0);    }    private void startJxta() {        try {            // Discover (or create) and join the default jxta NetPeerGroup            netpg = PeerGroupFactory.newNetPeerGroup();        } catch (PeerGroupException e) {            //Couldn't initialize; can't continue            System.out.println("Fatal error : creating the NetPeerGroup");            System.exit(1);        }        // Discover and join the RestoNet Peergroup        try {            if (!joinRestoNet()) {                System.out.println("Sorry could not find the RestoNet Peergroup");                System.exit(2);            }        } catch (Exception e) {            System.out.println("Can't join RestoNet group");            System.exit(1);        }        // 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");            System.exit(1);        }        // Attempt to locate RestoPeers in RestoNet        discoverRestoPeers();        // Connect to RestoPeers that have been discovered        connectToRestoPeers();        // I am hungry. Send an auction request for French Fries        // to the connected RestoPeers.        sendFriesAuctionRequests();        //Process incoming bids from RestoPeers        receiveFriesBids();    }    // This method is used to discover the RestoNet Peergroup.    // If found the peer will join the peergroup    private boolean joinRestoNet() {        int count = 3; // maximum number of attempts to discover        System.out.println("Attempting to discover the RestoNet Peergroup");        // Get the Discovery service handle from the NetPeerGroup        DiscoveryService hdisco = netpg.getDiscoveryService();        // All discovered RestoNet Peers        Enumeration ae = null;        // Loop until we find the "RestoNet" Peergroup advertisement        // or we've exhausted the desired number of attempts        while (count-- > 0) {            try {                // Check if we have the advertisement in the local                // peer cache                ae = hdisco.getLocalAdvertisements(DiscoveryService.GROUP,                                            "Name", "RestoNet");                // If we found the RestoNet advertisement, we are done                if ((ae != null) && ae.hasMoreElements())                    break;                // The RestoNet advertisement is not in the local                // cache . Send a discovery request to search for it.                hdisco.getRemoteAdvertisements(null,                           DiscoveryService.GROUP, "Name", "RestoNet", 1, null);                // Wait to give peers a chance to respond                try {                    Thread.sleep(timeout);                } catch (InterruptedException ie) {}            } catch (IOException e) {                // Found nothing! Move on.            }        }        // Check if we found the RestoNet advertisement        if (ae == null || !ae.hasMoreElements()) {            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            restoNet = netpg.newGroup(adv);            // Get the Discovery and Pipe services 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 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 {            // 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);            // Set the pipe type to be unicast unidrectional            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.    // RestoPeers are discovered via their published pipe advertisement.    private void discoverRestoPeers() {        int found = 0;           // Count of RestoPeers found        int count = 10;          // Discovery retries        System.out.println("Locating RestoPeers in the RestoNet Peergroup");

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区三区蝌蚪| 午夜成人免费视频| 成人免费视频网站在线观看| 精品精品国产高清a毛片牛牛| 久久精品99久久久| 国产欧美日产一区| 97精品国产露脸对白| 亚洲电影一级片| 日韩欧美亚洲国产另类| 国产一区二区免费视频| 国产精品美女久久久久久久 | 91麻豆精品国产| 日本va欧美va精品发布| 26uuu国产一区二区三区| 成人激情小说网站| 亚洲影院免费观看| 91精品国产综合久久福利软件| 免费观看成人av| 国产精品久久夜| 欧美人牲a欧美精品| 国产成人精品免费在线| 一区二区视频在线| 欧美sm极限捆绑bd| 91久久一区二区| 久久www免费人成看片高清| 欧美国产日韩在线观看| 欧美丰满少妇xxxbbb| 国产盗摄精品一区二区三区在线 | 久久亚洲一级片| 日本丰满少妇一区二区三区| 美女脱光内衣内裤视频久久网站| 国产欧美日韩在线看| 欧美羞羞免费网站| 91原创在线视频| 亚洲国产中文字幕在线视频综合| 久久精品免费在线观看| 欧美午夜电影网| 丁香婷婷综合激情五月色| 天天综合色天天| 亚洲人成网站色在线观看| 91精品久久久久久久99蜜桃| 99re在线视频这里只有精品| 精品一区二区三区蜜桃| 一区二区三区中文字幕在线观看| xnxx国产精品| 5858s免费视频成人| 成人a级免费电影| 国模无码大尺度一区二区三区| 亚洲国产精品一区二区久久恐怖片| 久久久不卡网国产精品二区| 91精品国产一区二区三区蜜臀| 97se亚洲国产综合自在线观| 国产美女精品人人做人人爽| 日韩av中文在线观看| 亚洲欧美偷拍三级| 中文字幕精品综合| 2017欧美狠狠色| 欧美一二三区精品| 欧美性生交片4| 91丨porny丨中文| 成人免费视频app| 国产乱码精品1区2区3区| 亚洲第一成人在线| 一级精品视频在线观看宜春院| 欧美韩国一区二区| 久久久影视传媒| 亚洲精品一区二区在线观看| 欧美日韩中文另类| 在线区一区二视频| 91麻豆成人久久精品二区三区| 国产成a人亚洲| 激情小说亚洲一区| 久久成人免费网站| 久久精品av麻豆的观看方式| 久久国产乱子精品免费女| 性感美女极品91精品| 亚洲一级不卡视频| 亚洲伦在线观看| 亚洲欧美日韩国产成人精品影院 | 91麻豆国产精品久久| 高清不卡一区二区| 国产激情视频一区二区三区欧美| 国产一区免费电影| 97久久精品人人做人人爽50路| 成人国产精品免费观看动漫| 处破女av一区二区| 91小视频免费观看| 在线亚洲欧美专区二区| 欧美亚洲自拍偷拍| 88在线观看91蜜桃国自产| 欧美一区二区三区四区高清 | 国产一区二区精品久久| 国产成人在线视频网站| www.66久久| 在线观看日韩国产| 欧美日韩一区中文字幕| 日韩精品一区二区在线| 国产日韩影视精品| 最新欧美精品一区二区三区| 亚洲久本草在线中文字幕| 亚洲成人精品影院| 久久国产精品免费| jvid福利写真一区二区三区| 91免费观看在线| 欧美一区二区视频在线观看| 国产欧美va欧美不卡在线| 亚洲精品亚洲人成人网| 天天操天天色综合| 国产一本一道久久香蕉| 色婷婷国产精品| 欧美一区二区播放| 中文在线免费一区三区高中清不卡| 国产精品久久久爽爽爽麻豆色哟哟| 亚洲一二三区在线观看| 久久99精品国产麻豆不卡| 大陆成人av片| 制服丝袜亚洲网站| 日本一区二区高清| 日韩激情一二三区| 北条麻妃一区二区三区| 91精品在线免费观看| 欧美国产日韩a欧美在线观看| 一区二区三区在线免费播放| 另类小说视频一区二区| 一本大道久久a久久综合婷婷| 日韩女同互慰一区二区| 亚洲欧美色图小说| 国产一区二区按摩在线观看| 在线精品视频免费观看| 日韩欧美精品在线视频| 亚洲综合自拍偷拍| 国产成人av电影| 欧美成人免费网站| 午夜一区二区三区视频| www.亚洲色图.com| 欧美成人一区二区三区片免费 | 成人性生交大合| 欧美精品一区二区在线观看| 亚洲欧美日韩小说| 国产精品一区二区在线观看不卡| 欧美色图片你懂的| 国产精品欧美精品| 久久99国产精品尤物| 欧美日韩国产中文| 亚洲欧美国产77777| 国产剧情一区在线| 日韩精品专区在线影院重磅| 一区二区三区不卡在线观看| 国产sm精品调教视频网站| 日韩一区二区精品| 日韩精品一级中文字幕精品视频免费观看 | 亚洲一区二区三区不卡国产欧美| 高潮精品一区videoshd| 精品国产免费久久| 免费一级片91| 欧美一区二区在线视频| 亚洲在线中文字幕| 色婷婷综合久久久中文字幕| 亚洲桃色在线一区| 成人蜜臀av电影| 国产日韩精品一区二区浪潮av| 韩国av一区二区三区| 精品国产乱码久久久久久浪潮| 麻豆极品一区二区三区| 日韩免费电影网站| 久国产精品韩国三级视频| 日韩欧美中文字幕制服| 麻豆视频观看网址久久| 精品国产一区a| 国产精品资源在线看| 2023国产一二三区日本精品2022| 麻豆国产欧美一区二区三区| 2020日本不卡一区二区视频| 韩国精品免费视频| 国产女人aaa级久久久级| 成人精品一区二区三区四区| 国产精品久久午夜| 欧美综合色免费| 亚洲一区二区在线免费观看视频| 在线看国产一区二区| 亚洲高清免费视频| 日韩三级av在线播放| 国产精品一区专区| 亚洲欧美另类在线| 欧美日韩在线精品一区二区三区激情| 亚洲成a人v欧美综合天堂下载 | 日韩影视精彩在线| 日韩三级视频在线看| 国产精品一区二区免费不卡| 国产欧美日韩中文久久| 91激情五月电影| 免费精品99久久国产综合精品| 亚洲精品在线观看视频| 播五月开心婷婷综合| 亚洲自拍偷拍麻豆| 精品少妇一区二区三区免费观看| 高清不卡在线观看av| 亚洲超丰满肉感bbw| 精品久久久久久久久久久久久久久 | 亚洲人xxxx|