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

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

?? hungrypeer.java

?? p2p 源代碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
                // Check if we already have restaurant advertisements                // in our local peer cache                Enumeration ae =                    disco.getLocalAdvertisements(DiscoveryService.ADV, "Name",                                       "JXTASPEC:RestoNet:Service:*");                // If we found some advertisements in the cache,                // add them to the list                if (ae != null && ae.hasMoreElements()) {                    // Reset count and RestoPeerAdvs as we have                    // just retrieved all advertisements, including                    // previously cached ones                    found = 0;                    restoPeerAdvs.removeAllElements();                    while (ae.hasMoreElements()) {                        restoSrv = (ModuleSpecAdvertisement) ae.nextElement();                        // Extract the pipe advertisement from the                        // service module spec adv. The pipe advertisement                        // is used to connect to the service; it is                        // part of the Param section of the advertisement                        restoPeerAdvs.addElement(restoSrv.getPipeAdvertisement());                        ++found;                    }                    if (found > 1)                        break;         // Want to find at least two                }                // Did not find enough advertisement in the cache.                // Send a remote discovery request to search for more                // RestoPeer service advertisements                disco.getRemoteAdvertisements(null,                                DiscoveryService.ADV,                                "Name", "JXTASPEC:RestoNet:Service:*", 5, null);                // Give the peers a chance to respond                try {                    Thread.sleep(timeout);                } catch (InterruptedException e) {}            } catch (IOException e){                // Found nothing! Move on            }        }        // Completed RestoPeer Discovery        System.out.println("Found " + found + " RestoPeer Service(s)");    }    // Method to connect and open output pipes to all the    // RestoPeers that we have discovered. Each RestoPeer is    // identified by its unique RestoPeer pipe advertisement.    private void connectToRestoPeers() {        // Enumerate all the RestoPeer pipe advertisments we have discovered        // and attempt to connect a pipe which each of them        for (Enumeration en = restoPeerAdvs.elements();             en.hasMoreElements();) {            PipeAdvertisement padv = (PipeAdvertisement) en.nextElement();            try {                System.out.println(                    "Attempting to connect to discovered RestoPeer");                // Create an output pipe connection to the RestoPeer                OutputPipe pipeOut = pipes.createOutputPipe(padv,                                                            rtimeout);                // Check if we have a connected pipe                if (pipeOut == null) {                    // Failed; go to next RestoPeer                    System.out.println(                        "Failure to connect to RestoPeer Pipe:" +                        padv.getName());                    continue;                }                // Save the output pipe                restoPeerPipes.addElement(pipeOut);                System.out.println("Connected pipe to " + padv.getName());            } catch (Exception e) {                // Error during connection go to next RestoPeer                System.out.println("RestoPeer may not be there anymore:" +                                    padv.getName());                 continue;            }        }    }    // Send an auction request for French Fries to all the RestoPeer    // pipes we have successfully connected    private void sendFriesAuctionRequests() {        // Enumerate all the RestoPeer pipe connections we have successfully        // connected to        for (Enumeration en = restoPeerPipes.elements();            en.hasMoreElements();) {            OutputPipe op = (OutputPipe) en.nextElement();            try {                // Construct the request document                StructuredDocument request  =                    StructuredDocumentFactory.newStructuredDocument(mimeType,                    "RestoNet:Request");                // Fill up the Fries auction request argument                Element re;                re = request.createElement("Name", myIdentity);                request.appendChild(re);                re = request.createElement("Fries", friesRequest);                request.appendChild(re);                // Create the pipe message to send                Message msg = pipes.createMessage();                // Fill the first message element which is the HungryPeer                // pipe advertisement return address. We need this                // so RestoPeers can respond to us                msg.addElement(msg.newMessageElement("HungryPeerPipe",                         mimeType, myAdv.getDocument(mimeType).getStream()));                // Fill the second message element, which is                // the fries request. Insert the document                // in the message                msg.addElement(msg.newMessageElement("Request",                         mimeType, request.getStream()));                // Send the auction message to the RestoPeer                op.send(msg);                System.out.println("Sent Fries Auction Request ("                    + friesRequest + ") to connected peers");            } catch (Exception ex) {                // Error sending auction request                System.out.println(                    "Failed to send auction request to RestoPeer");            }        }    }    // Receive bid requests from RestoPeers on the    // HungryPeer listening pipe    private void receiveFriesBids() {        // Continue until we get all answers        while (true) {            Message msg = null;      // Pipe message received            String price = null;     // Fries price bid            String brand = null;     // RestoPeer name which offers the bid            String specials = null;  // Specials offer bid            InputStream ip = null;   // Input stream to read message element            StructuredDocument bid = null; //Bid document received            try {                // Wait for a bid message to arrive from a RestoPeer                // Will block until a message arrive                msg = myPipe.waitForMessage();                // Check if the message is valid                if (msg == null) {                    if (Thread.interrupted()) {                        // We have been asked to stop                        System.out.println(                            "Abort Receiving bid loop interrupted");                        myPipe.close(); // Close the Pipe                        return;                    }                }            } catch (Exception ex) {                // Error in receiving message                myPipe.close();                System.out.println("Abort Receiving Error receiving bids");                return;            }            // We got a message from a RestoPeer.            // Extract and display infomation about the bid received.            try {                // Extract the Bid document from the message                ip = msg.getElement("Bid").getStream();                bid = StructuredDocumentFactory.newStructuredDocument(                            mimeType, ip);                // Parse the document to extract bid information                Enumeration enum = bid.getChildren();                while (enum.hasMoreElements()) {                    Element element = (Element) enum.nextElement();                    String attr = (String) element.getKey();                    String value = (String) element.getValue();                    if (attr.equals("Price")) {                        price = value;                        continue;                    }                    if (attr.equals("Brand")) {                        brand = value;                        continue;                    }                    if (attr.equals("Specials")) {                        specials = value;                        continue;                    }                }                // We got a valid bid. Print it.                System.out.println("Received Fries Bid from RestoPeers (" +                           brand + ") at a Price ($" + price +                           ") \nRestoPeers Special (" + specials + ")");            } catch (Exception e) {                // Broken content                System.out.println("Error extracting bid from the message");                continue;            }        }    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本欧美一区二区三区乱码| 成人ar影院免费观看视频| 韩国女主播一区| 91福利视频久久久久| 日韩视频免费观看高清完整版| 国产精品欧美极品| 日本欧美大码aⅴ在线播放| 成人精品小蝌蚪| 日韩一级片在线观看| 一区二区三区自拍| 国产91丝袜在线播放0| 欧美一区二区三区小说| 亚洲蜜臀av乱码久久精品| 久久91精品国产91久久小草| 色婷婷综合久久久| 国产精品三级视频| 国产一区在线不卡| 制服丝袜亚洲色图| 午夜精品久久久久久久蜜桃app| 成人av电影在线| 国产天堂亚洲国产碰碰| 精一区二区三区| 欧美精品色综合| 夜夜嗨av一区二区三区| 91视频国产观看| 国产午夜一区二区三区| 极品尤物av久久免费看| 日韩欧美电影在线| 日韩黄色小视频| 欧美二区在线观看| 午夜久久电影网| 欧美男生操女生| 亚洲成人777| 欧美日韩精品系列| 日韩vs国产vs欧美| 欧美一级夜夜爽| 青青草精品视频| 日韩欧美卡一卡二| 久久精工是国产品牌吗| 精品欧美黑人一区二区三区| 久久aⅴ国产欧美74aaa| 精品国产91洋老外米糕| 国产麻豆日韩欧美久久| 久久久久久黄色| 成人18视频在线播放| 亚洲精品亚洲人成人网| 欧美人与性动xxxx| 日韩不卡一区二区| 精品日韩一区二区| 国产福利不卡视频| 中文幕一区二区三区久久蜜桃| av在线不卡电影| 亚洲超碰精品一区二区| 制服视频三区第一页精品| 激情综合色丁香一区二区| 欧美国产亚洲另类动漫| 日本高清成人免费播放| 亚洲不卡av一区二区三区| 日韩视频一区二区在线观看| 国产精品 日产精品 欧美精品| 国产精品久久久久影院| 欧美特级限制片免费在线观看| 日韩国产在线一| 久久―日本道色综合久久| av亚洲精华国产精华| 无吗不卡中文字幕| 国产蜜臀av在线一区二区三区| 一本色道久久综合精品竹菊| 日韩av不卡在线观看| 国产亚洲精品资源在线26u| eeuss鲁片一区二区三区| 午夜av一区二区| 国产精品素人视频| 欧美精品 国产精品| 国产盗摄视频一区二区三区| 亚洲精品高清视频在线观看| 日韩一区二区在线看片| 91一区二区在线观看| 久久精品国产一区二区| 一区二区三区国产豹纹内裤在线 | 免费看日韩精品| 欧美激情艳妇裸体舞| 51精品久久久久久久蜜臀| 成人99免费视频| 久久国产尿小便嘘嘘| 亚洲精品国产第一综合99久久| 久久青草国产手机看片福利盒子| 在线免费av一区| 成人av第一页| 国产米奇在线777精品观看| 五月天激情综合网| 亚洲欧美日韩国产另类专区| 国产欧美一区二区精品久导航 | 日韩美女主播在线视频一区二区三区| 成人少妇影院yyyy| 激情另类小说区图片区视频区| 亚洲国产日韩一级| 国产精品区一区二区三| 精品国产乱码久久久久久免费| 欧美三片在线视频观看| 色综合久久中文综合久久97| 丰满放荡岳乱妇91ww| 国产美女视频91| 国产精品综合av一区二区国产馆| 日韩中文字幕区一区有砖一区 | 久久久久久久综合日本| 这里是久久伊人| 欧美男女性生活在线直播观看| 色综合天天狠狠| 97国产精品videossex| 成人app网站| av电影在线观看不卡| 成人免费视频caoporn| 国产黑丝在线一区二区三区| 国产成人丝袜美腿| 国产成人午夜高潮毛片| 国产电影精品久久禁18| 美女在线一区二区| 精品中文字幕一区二区| 黄色资源网久久资源365| 狠狠色伊人亚洲综合成人| 国产一区二区免费视频| 国产乱子伦一区二区三区国色天香| 黑人巨大精品欧美黑白配亚洲| 九九九久久久精品| 久久99九九99精品| 国产成人鲁色资源国产91色综 | 看电影不卡的网站| 日韩精品亚洲专区| 蜜臀av性久久久久av蜜臀妖精 | 成人av动漫在线| 91精品国产综合久久福利软件| 4438x亚洲最大成人网| 欧美成人三级电影在线| 久久久久久9999| 亚洲三级免费电影| 亚洲第一主播视频| 精品亚洲成av人在线观看| 成人免费毛片片v| 91国内精品野花午夜精品| 欧美日韩中文一区| 精品国产一区二区三区忘忧草| 国产欧美日本一区视频| 亚洲一区二区三区精品在线| 日韩综合在线视频| 国产91精品一区二区麻豆网站 | 成人一级片在线观看| 色香色香欲天天天影视综合网| 欧美伦理电影网| 中文字幕欧美区| 亚洲国产欧美在线| 国内久久精品视频| 色噜噜狠狠成人中文综合| 91精品国产乱| 中文字幕欧美激情| 日韩成人免费电影| 99国产精品国产精品毛片| 制服丝袜亚洲网站| 亚洲人成精品久久久久久| 精品综合免费视频观看| 在线观看网站黄不卡| 欧美精品一区二区三区视频| 亚洲女人****多毛耸耸8| 日本va欧美va精品发布| 一本一道综合狠狠老| 精品国产精品一区二区夜夜嗨| 樱花影视一区二区| 激情五月婷婷综合网| 欧美美女直播网站| 国产精品视频一二三| 美女国产一区二区三区| 99久久国产综合精品色伊 | xf在线a精品一区二区视频网站| 中文字幕五月欧美| 久久精品国产精品亚洲精品 | 亚洲欧美日韩小说| 国产一级精品在线| 日韩欧美一二三| 午夜精品福利久久久| 91亚洲国产成人精品一区二三| 久久免费的精品国产v∧| 热久久国产精品| 欧美日韩一区不卡| 樱花影视一区二区| 不卡电影免费在线播放一区| 久久久国产精华| 经典三级一区二区| 欧美电影免费观看完整版| 天天做天天摸天天爽国产一区| 日本精品一区二区三区高清| 中文字幕一区二区三区四区| 国产精品综合视频| 久久综合网色—综合色88| 美女脱光内衣内裤视频久久网站| 欧美日本一区二区三区四区| 亚洲不卡av一区二区三区| 欧美探花视频资源| 亚洲成av人在线观看| 欧美天堂一区二区三区| 国产一区二区伦理|