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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? restopeer.java

?? p2p 源代碼
?? JAVA
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
                }                // We received a message; extract the request                try {                    // Extract the HungryPipe pipe information                    // to reply to the sender                    ip = msg.getElement("HungryPeerPipe").getStream();                    // Construct the associated pipe advertisement                    // via the AdvertisementFactory                    hungryPipe = (PipeAdvertisement)                    AdvertisementFactory.newAdvertisement(mimeType, ip);                    // Extract the sender name and fries size requested                    // building a StructuredDocument                    ip = msg.getElement("Request").getStream();                    request = StructuredDocumentFactory.newStructuredDocument                                    (mimeType, ip);                    // Extract the fields from the structured Document                    Enumeration enum = request.getChildren();                    // Loop over all the elements of the document                    while (enum.hasMoreElements()) {                        el = (Element) enum.nextElement();                        String attr = (String) el.getKey();                        String value = (String) el.getValue();                        // Extract the HungryPeer Requester Name                        if (attr.equals("Name")) {                            name = value;                            continue;                        }                        // Extract the Fries  size requested                        else if (attr.equals("Fries")) {                            size = value;                            continue;                        }                    }                } catch (Exception e) {                    continue; // Broken content; silently discard                }                System.out.println("Received Request from HungryPeer "                               + name                               + " for "                               + size                               + " Fries.");                // The auction request is valid. We can                // create the output pipe to send the response bid to                // the HungryPeer requester                try {                    System.out.println(                        "Attempting to create Output Pipe to HungryPeer " +                        name);                    // Create an output pipe connection to the HungryPeer                    pipeOut = pipes.createOutputPipe(hungryPipe,                                                     rtimeout);                    // Check if we have a pipe                    if (pipeOut == null) {                        // Cannot conect the pipe                        System.out.println("Could not find HungryPeer pipe");                        continue;                    }                } catch (Exception e) {                    // Pipe creation exception                    System.out.println("HungryPeer may not be listening anymore");                    continue;                }                // We have a pipe connection to the HungryPeer.                // Now create the Bid Response document                try {                    // Construct the Response document                    bid = StructuredDocumentFactory.newStructuredDocument(                                     mimeType,                                     "RestoNet:Bid");                    // Set the Bid values (Brand, price, special)                    // in the response document                    el = bid.createElement("Brand", brand);                    bid.appendChild(el);                    el = bid.createElement("Price", friesPrice(size));                    bid.appendChild(el);                    el = bid.createElement("Specials", specials);                    bid.appendChild(el);                    // Create a new pipe message                    msg = pipes.createMessage();                    // Push the Bid offer in the message                    msg.addElement(msg.newMessageElement(                                   "Bid",mimeType, bid.getStream()));                    // Send the message                    pipeOut.send(msg);                    // Close the output pipe connection                    pipeOut.close();                } catch (Exception ex) {                    System.out.println(                        "Error sending bid offer to HungryPeer " + name);                    continue;                }                System.out.println("Sent Bid Offer to HungryPeer (" + name +                       ") Fries price = "  + friesPrice(size) +                       ", special = " + specials);            } catch (Exception e) {               System.out.println("Abort RestoPeer interrupted");               return;            }        }    }    // Determine the price of the French fries depending on the size    private String friesPrice(String size) {        if (size.equals("small"))              return "$1.50";        if (size.equals("medium"))              return "2.50";        if (size.equals("large"))              return "3.00";        return "error";    }    // Create the resto pipe associated with this RestoPeer.    // Discover first if a pipe advertisement exists, if    // not create and publish it.    private boolean createRestoPipe() {        int count = 3;           // Discovery retry count        Enumeration ae = null;   // Discovery response enumeration        try {            System.out.println(                "Attempting to Discover the Restaurant RestoPipe");            // Check if I have already published myself            while (count-- > 0) {                try {                    // Check first locally if we have the advertisement cached                    ae = disco.getLocalAdvertisements(DiscoveryService.ADV,                                      "name", "RestoNet:RestoPipe:" + brand);                    // If we found our pipe advertisement we are done                    if (ae != null && ae.hasMoreElements())                        break;                    // We did not find the advertisement locally;                    // send a remote request                    disco.getRemoteAdvertisements(null,                          DiscoveryService.ADV, "name",                          "RestoNet:RestoPipe:" + brand, 1, null);                    // Sleep to allow time for peers to respond to the                    // discovery request                    try {                        Thread.sleep(timeout);                    } catch (InterruptedException e) {}                } catch (IOException e) {                    // Found nothing! Move on                }            }            if (ae == null || !ae.hasMoreElements()) {                // We did not find the pipe advertisement, so create one                System.out.println(                    "Could not find the Restaurant Pipe Advertisement");                // Create a pipe advertisement for our RestoPeer                myAdv = (PipeAdvertisement)                    AdvertisementFactory.newAdvertisement(                        PipeAdvertisement.getAdvertisementType());                // Assign a unique ID to the pipe                myAdv.setPipeID(                        IDFactory.newPipeID(restoNet.getPeerGroupID() ));                // The symbolic name of the pipe is built from                // the brand name of RestoPeer;  each RestoPeer                // must therefore have a unique name.                myAdv.setName("RestoNet:RestoPipe:" + brand);                // Set the type of the pipe to be unidirectional                myAdv.setType(PipeService.UnicastSecureType);                // We have the advertisement; publish it                // into our local cache and to the RestoNet PeerGroup.                // We use the default lifetime and the default                // expiration time for remote publishing                disco.publish(myAdv, DiscoveryService.ADV,                              PeerGroup.DEFAULT_LIFETIME,                              PeerGroup.DEFAULT_EXPIRATION);                disco.remotePublish(myAdv, DiscoveryService.ADV,                              PeerGroup.DEFAULT_EXPIRATION);                System.out.println(                    "Created the Restaurant Pipe Advertisement");            } else {                // We found an existing pipe advertisement                myAdv = (PipeAdvertisement) ae.nextElement();                System.out.println("Found Restaurant Pipe Advertisement");            }            // Create my input pipe to listen for hungry peers            // requests            pipeIn = pipes.createInputPipe(myAdv);        } catch (Exception e) {            System.out.println("Could not initialize the Restaurant pipe");            return false;        }        return true;    }    private PeerGroupID mkGroupID() throws Exception {        return (PeerGroupID) IDFactory.fromURL(             new URL("urn", "", groupURL));    }}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一区二区欧美日韩 | 欧美一区二区三区日韩| 99精品欧美一区| 成人综合婷婷国产精品久久蜜臀| 久久电影网电视剧免费观看| 午夜日韩在线观看| 午夜激情一区二区三区| 天堂一区二区在线免费观看| 丝袜美腿亚洲一区| 青青草国产成人av片免费| 日韩激情一二三区| 久久狠狠亚洲综合| 国内精品在线播放| 国产成人精品免费| 91啪亚洲精品| 在线观看网站黄不卡| 91精品1区2区| 欧美一级高清片在线观看| 日韩三级视频在线观看| 久久婷婷久久一区二区三区| 精品欧美久久久| 国产精品国产馆在线真实露脸| 国产精品久久久久久久久免费桃花| 国产精品福利av| 一区二区三区四区乱视频| 亚洲国产日产av| 久久爱www久久做| 波多野洁衣一区| 欧美区视频在线观看| 久久嫩草精品久久久久| 国产精品午夜春色av| 亚洲国产日日夜夜| 国产精品中文字幕欧美| 91久久精品一区二区三| 日韩精品一区二区三区中文不卡 | 一区二区三区精品在线观看| 午夜伦理一区二区| 国产成人自拍网| 色94色欧美sute亚洲线路一ni| 欧美精品久久天天躁| 国产日韩欧美亚洲| 亚洲v日本v欧美v久久精品| 国内精品第一页| 91久久香蕉国产日韩欧美9色| 欧美成va人片在线观看| 一区二区三区四区激情| 国产麻豆视频一区| 在线成人小视频| 国产精品免费看片| 久久精品国产亚洲aⅴ| 一本大道久久a久久精二百| 久久亚洲精华国产精华液| 一区二区三区在线观看视频| 国产精品夜夜爽| 日韩欧美精品在线| 亚洲成a天堂v人片| 91女厕偷拍女厕偷拍高清| 国产午夜一区二区三区| 日韩av电影天堂| 91成人在线观看喷潮| 欧美精彩视频一区二区三区| 免费成人av在线| 777亚洲妇女| 一区二区三区91| 97精品电影院| 国产精品毛片高清在线完整版| 精品中文字幕一区二区 | 首页欧美精品中文字幕| 91视频你懂的| 中文字幕在线观看不卡视频| 国产成人免费视频| 国产人妖乱国产精品人妖| 国内成人精品2018免费看| 91精品国产一区二区三区香蕉| 亚洲动漫第一页| 在线观看日韩国产| 亚洲精品亚洲人成人网在线播放| 成人av片在线观看| 中文字幕永久在线不卡| 99久久精品国产网站| 国产精品美女www爽爽爽| 成人综合在线观看| 国产精品乱码一区二三区小蝌蚪| 成人免费看片app下载| 欧美国产乱子伦| 99久久99久久精品免费看蜜桃| 国产精品免费免费| 91福利社在线观看| 三级成人在线视频| 欧美大片免费久久精品三p| 国产一区在线观看视频| 久久久欧美精品sm网站| 成人看片黄a免费看在线| 亚洲欧美偷拍卡通变态| 欧美日韩精品系列| 久久精品国产亚洲一区二区三区 | 94-欧美-setu| 亚洲一区二区三区精品在线| 欧美剧情片在线观看| 捆绑调教一区二区三区| 亚洲国产精品ⅴa在线观看| 91免费国产在线| 日韩专区一卡二卡| 久久久www成人免费无遮挡大片| 国产成人精品三级| 亚洲小说欧美激情另类| 26uuu亚洲综合色| 91网址在线看| 美腿丝袜亚洲综合| 国产精品亲子伦对白| 欧美日韩在线三级| 国产精品夜夜嗨| 亚洲电影一级片| 久久久天堂av| 欧美女孩性生活视频| 国产suv精品一区二区三区| 亚洲一二三专区| 国产亚洲一区二区三区| 欧美视频一区在线| 国产精品一区二区三区四区| 一区二区高清视频在线观看| 日韩一区二区精品| 日本大香伊一区二区三区| 国产成人免费视频网站高清观看视频| 亚洲国产一区二区在线播放| 国产丝袜在线精品| 制服丝袜一区二区三区| av影院午夜一区| 国产乱国产乱300精品| 日韩激情在线观看| 亚洲影视在线观看| 国产精品久久久久婷婷| 精品国产百合女同互慰| 欧美性生活一区| 91免费小视频| 成人高清视频在线观看| 国内外成人在线| 久久国产精品露脸对白| 午夜久久久久久| 亚洲视频精选在线| 日本一区二区三区久久久久久久久不| 91精品国产入口在线| 欧美三级欧美一级| 在线亚洲精品福利网址导航| 成人aa视频在线观看| 国产永久精品大片wwwapp | 成人高清免费在线播放| 久草热8精品视频在线观看| 婷婷综合另类小说色区| 一区二区三区四区乱视频| 亚洲人成网站影音先锋播放| 中文字幕中文字幕在线一区| 中文字幕av在线一区二区三区| 久久久久久久久99精品| 久久亚洲一区二区三区四区| 久久综合久久久久88| 久久这里只精品最新地址| 2023国产精品| 欧美成人一区二区三区在线观看| 欧美一区二区三区性视频| 日韩一区二区三区av| 日韩精品一区二区三区中文精品| 欧美成人官网二区| 国产免费观看久久| 国产精品美女久久久久久| 亚洲人成精品久久久久久| 一片黄亚洲嫩模| 婷婷亚洲久悠悠色悠在线播放| 日韩在线观看一区二区| 美美哒免费高清在线观看视频一区二区 | 欧美日韩一区二区在线观看视频 | 裸体一区二区三区| 国模娜娜一区二区三区| 国产精品亚洲第一区在线暖暖韩国| 国产成人免费视频网站| 91麻豆免费在线观看| 在线观看国产日韩| 日韩一区二区精品在线观看| 国产午夜三级一区二区三| 亚洲少妇最新在线视频| 午夜精品久久一牛影视| 另类调教123区 | 91精品国产综合久久精品app| 日韩一区二区三区视频在线观看| 久久婷婷一区二区三区| 一区二区三区在线视频免费观看| 天堂va蜜桃一区二区三区| 国产v综合v亚洲欧| 欧美日韩国产精选| 久久免费美女视频| 亚洲理论在线观看| 久久国产夜色精品鲁鲁99| 99久久伊人精品| 欧美精品乱码久久久久久| 国产人成亚洲第一网站在线播放| 一区二区三区影院| 成人黄色免费短视频| 日韩欧美一区电影| 综合av第一页| 国产一区二区久久|