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

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

?? restopeer.java

?? p2p 源代碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
                }                // 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;    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲免费成人av| 亚洲一区二区在线免费看| 国产精品99久| 国产精品女同一区二区三区| 成人午夜又粗又硬又大| 中文字幕亚洲电影| 91久久久免费一区二区| 视频在线观看国产精品| 91精品国产一区二区三区蜜臀| 久久国产免费看| 国产色爱av资源综合区| 色综合咪咪久久| 日韩精品亚洲专区| 久久久久久久综合狠狠综合| 成人国产亚洲欧美成人综合网| 日本韩国欧美一区二区三区| 亚洲va韩国va欧美va精品| 日韩欧美卡一卡二| 成人avav在线| 性做久久久久久久免费看| 精品国产第一区二区三区观看体验| 国产aⅴ精品一区二区三区色成熟| 亚洲免费在线看| 337p亚洲精品色噜噜噜| 国产99精品国产| 亚洲电影欧美电影有声小说| 2023国产精品| 91丨porny丨户外露出| 首页国产丝袜综合| 国产亚洲欧美一级| 欧美在线你懂得| 狠狠色综合播放一区二区| 亚洲视频香蕉人妖| 日韩免费福利电影在线观看| 99久久伊人网影院| 蜜臀av一区二区在线观看| 国产精品天天看| 91精品国产综合久久精品图片| 国产精品资源网站| 亚洲五码中文字幕| 久久久www成人免费毛片麻豆| 99国产精品久久久久久久久久久| 日韩黄色免费网站| 国产精品电影一区二区三区| 日韩视频中午一区| 一本色道久久加勒比精品| 久久99热99| 亚洲国产视频在线| 国产精品女同一区二区三区| 日韩午夜av一区| 色噜噜久久综合| 国产一区二区三区四区五区入口 | 日韩美女一区二区三区| 波波电影院一区二区三区| 美女视频黄免费的久久 | 国产成人精品三级麻豆| 亚洲欧美日韩国产综合在线| 欧美大片一区二区| 欧美亚洲国产怡红院影院| 成人精品视频一区二区三区尤物| 日本美女视频一区二区| 亚洲综合色视频| 国产精品美日韩| 精品国产乱码久久久久久1区2区| 91成人免费在线视频| 国产电影一区二区三区| 久久精品理论片| 亚洲成年人网站在线观看| 亚洲日本丝袜连裤袜办公室| 久久精品亚洲麻豆av一区二区| 欧美精品在线一区二区| 91成人免费在线视频| 99精品久久99久久久久| 国产成人综合亚洲网站| 日韩成人午夜精品| 亚洲444eee在线观看| 一区二区三区国产| 国产精品福利一区| 国产清纯美女被跳蛋高潮一区二区久久w| 91精品国产免费| 精品视频1区2区3区| 色哟哟一区二区在线观看| 9久草视频在线视频精品| 国产电影一区在线| 国产美女av一区二区三区| 毛片av中文字幕一区二区| 日韩毛片视频在线看| 一区二区三区在线视频免费观看| 久久久久久久久久久黄色| 欧美一区二区播放| 制服丝袜亚洲精品中文字幕| 精品视频在线免费| 欧美日韩美少妇| 欧美日韩精品欧美日韩精品一综合| 色综合色狠狠天天综合色| 91亚洲国产成人精品一区二区三| 成人小视频在线| 成人国产亚洲欧美成人综合网| 国产99一区视频免费| 国产精品18久久久久久久久| 国内成人自拍视频| 国内成+人亚洲+欧美+综合在线| 九色porny丨国产精品| 美日韩一区二区三区| 久草在线在线精品观看| 国产综合色产在线精品| 国产在线精品免费av| 国产成人免费xxxxxxxx| 成人一区二区视频| 成a人片亚洲日本久久| av资源网一区| 91农村精品一区二区在线| 在线观看av一区| 欧美日本国产视频| 日韩亚洲国产中文字幕欧美| 日韩欧美一区在线观看| 精品日本一线二线三线不卡| 久久久久9999亚洲精品| 国产精品免费丝袜| 日韩毛片精品高清免费| 中文字幕在线观看不卡| 久久蜜桃av一区二区天堂| 国产午夜亚洲精品午夜鲁丝片 | 56国语精品自产拍在线观看| 91精品福利在线一区二区三区| 欧美不卡一区二区三区四区| 久久久久久久久久久久久久久99 | 1024成人网色www| 玉足女爽爽91| 日韩和欧美一区二区三区| 激情综合色播激情啊| 福利一区二区在线| 亚洲精品免费视频| 日韩影院免费视频| 精品一区二区久久久| 成人av网址在线观看| 91国产精品成人| 欧美军同video69gay| 26uuu亚洲婷婷狠狠天堂| 亚洲国产成人自拍| 亚洲高清视频中文字幕| 久久国产剧场电影| av激情成人网| 欧美日韩国产精选| 久久久久久亚洲综合影院红桃| 亚洲色图都市小说| 日韩成人一级大片| 国产69精品一区二区亚洲孕妇| 色婷婷久久99综合精品jk白丝| 9191国产精品| 中文字幕av一区二区三区免费看| 亚洲自拍欧美精品| 久久99国产精品久久| 成人18视频在线播放| 欧美日本在线播放| 久久久精品人体av艺术| 91精品国产一区二区三区香蕉| 日韩欧美精品在线| 中文字幕亚洲视频| 日本va欧美va欧美va精品| 国产99久久久国产精品潘金网站| 欧美自拍偷拍一区| 欧美不卡视频一区| 亚洲欧美电影一区二区| 开心九九激情九九欧美日韩精美视频电影| 成人久久18免费网站麻豆| 欧美精品电影在线播放| 国产精品久久久久久久久快鸭| 五月激情综合色| 不卡一区在线观看| 欧美一级高清大全免费观看| 中文字幕一区二区三区乱码在线| 日本麻豆一区二区三区视频| 99视频精品在线| 欧美tickling网站挠脚心| 亚洲蜜臀av乱码久久精品蜜桃| 国内精品免费在线观看| 欧美性猛交xxxx乱大交退制版| 久久一夜天堂av一区二区三区| 亚洲在线视频免费观看| 国产精品123区| 欧美一区二区久久| 亚洲你懂的在线视频| 国产精品1区2区3区| 欧美精品日韩一本| 最新中文字幕一区二区三区| 久草在线在线精品观看| 欧美日韩aaa| 1000精品久久久久久久久| 激情综合网av| 5566中文字幕一区二区电影| 亚洲乱码日产精品bd| 成人小视频在线| 久久新电视剧免费观看| 日韩高清不卡一区| 欧美视频精品在线观看| 亚洲人成网站在线| 成人午夜电影小说| 26uuu久久综合| 日韩av电影一区|