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

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

?? hungrypeer.java

?? p2p 源代碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
        try {            // extract the RestoPeer service from the RestoNet peergroup            // advertisement since it is now part of the RestoNet Peergroup            ID  msrvID = null;            PipeAdvertisement restoPipe = null;            // get the Spec ID for the RestoPeerService to lookup the service            // in the Peergroug handle            try {                msrvID = IDFactory.fromURL(new URL("urn", "",                         RestoPeerService.Module_Spec_ID));            } catch (java.net.MalformedURLException e) {            } catch (java.net.UnknownServiceException e) {                System.err.println(" Can't create restoPeer PipeID: UnknownServiceException ") ;                System.exit(1);            }            // lookup for the RestoPeer peergroup service            // we have to wait to make sure the service was completly initialized            // before we can lookup the service            while (restoSrv == null) {                try {                    Thread.sleep(2000);                    restoSrv = (RestoPeerService) restoNet.lookupService(msrvID);                } catch (Exception ex) { // This is ok                }            }            // Extract the pipe advertisement from the RestoPeer service module            // implementation advertisement. Get the ModuleImpl advertisement            // associated with the service            ModuleImplAdvertisement restoImpl = (ModuleImplAdvertisement)                restoSrv.getImplAdvertisement();            // extract the pipe from the param section of the Module Implementation            restoPipe = (PipeAdvertisement)                AdvertisementFactory.newAdvertisement((TextElement)                      restoImpl.getParam().getChildren().nextElement());            // save the pipe            restoPeerAdvs.addElement(restoPipe);            ++found;        } catch (Exception ex) {            System.out.println("Failure to connect to RestoPeer service pipe");            ex.printStackTrace();        }        // Completed RestoPeer Discovery        System.out.println("Found " + found + " RestoPeers Service");    }    // 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("Attempt 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 in RestoPeers connected structure                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 with        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                // the fries request. Insert the document                //in the message                msg.addElement(msg.newMessageElement("Request", mimeType,                     request.getStream()));                // send the auction message to the RestoPeer connected                // pipe                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 got 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()) {// interupted                        // 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. Let's            // 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. Let's print it                System.out.println("Received Fries Bid from RestoPeers (" +                                   brand + ") at a Price ($" + price +                                   ") \nRestoPeers Special (" + specials + ")");            } catch (Exception e) { // Error extracting bid from the message                System.out.println("Error extracting bid from the message");                continue; // broken content;            }        }    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品999久久久| 欧美一区二区三区成人| 国产一区二区伦理片| 久久成人免费日本黄色| 精品亚洲免费视频| 国产乱人伦偷精品视频不卡| 国产精品一区二区久久不卡| 国产成人啪免费观看软件| 国产精品2024| 波多野结衣欧美| 色偷偷一区二区三区| 欧美在线短视频| 欧美高清视频在线高清观看mv色露露十八 | 久久综合九色综合97_久久久| 欧美大黄免费观看| 国产区在线观看成人精品| 国产精品麻豆欧美日韩ww| 亚洲视频中文字幕| 午夜欧美在线一二页| 精品一区二区三区在线视频| 国产99久久精品| 欧洲人成人精品| 日韩精品中文字幕在线不卡尤物| 国产欧美一区二区三区在线看蜜臀 | 蜜臀精品一区二区三区在线观看 | 中文字幕av一区二区三区免费看| 中文字幕中文字幕一区| 午夜电影网亚洲视频| 国产综合色产在线精品| 色嗨嗨av一区二区三区| 日韩午夜在线观看| 亚洲人xxxx| 激情久久五月天| 色综合中文字幕国产 | 国产电影精品久久禁18| 在线观看精品一区| 久久综合狠狠综合| 亚洲一二三区不卡| 成人动漫一区二区三区| 4438x成人网最大色成网站| 久久久www成人免费无遮挡大片| 亚洲色图20p| 国产一区二区成人久久免费影院 | 国产一区二区福利视频| 欧美日韩极品在线观看一区| 日韩久久免费av| 午夜精品成人在线视频| www.日韩精品| 欧美大片国产精品| 视频一区视频二区中文| 91丨porny丨国产| 久久精品一区二区三区不卡牛牛| 亚洲成a人v欧美综合天堂| 99久久免费国产| 国产视频亚洲色图| 久久不见久久见中文字幕免费| 欧美色爱综合网| 一区二区三区在线观看视频| 成人免费看片app下载| 久久婷婷色综合| 美女一区二区久久| 91精品国产高清一区二区三区| 一级女性全黄久久生活片免费| 成人a区在线观看| 中文字幕精品三区| 国产伦精品一区二区三区免费迷| 91精品婷婷国产综合久久性色| 亚洲午夜影视影院在线观看| 91黄色激情网站| 亚洲午夜av在线| 欧美三级一区二区| 午夜av区久久| 制服丝袜亚洲播放| 蜜桃视频第一区免费观看| 日韩女同互慰一区二区| 经典一区二区三区| 国产亚洲人成网站| 成人av在线网| 一区二区三区四区中文字幕| 色先锋资源久久综合| 亚洲一二三区在线观看| 欧美日韩一区 二区 三区 久久精品| 亚洲综合在线电影| 欧美丝袜丝交足nylons图片| 性久久久久久久久| 精品国一区二区三区| 国内精品国产三级国产a久久| 久久久电影一区二区三区| 成人av免费观看| 一区二区三区在线观看网站| 4438x亚洲最大成人网| 久国产精品韩国三级视频| 欧美国产禁国产网站cc| 91在线国产观看| 午夜精品国产更新| 国产亚洲精品久| 91精品办公室少妇高潮对白| 日日夜夜免费精品| 国产视频一区在线播放| 91黄色免费看| 国产资源在线一区| 夜夜爽夜夜爽精品视频| 日韩一二三区不卡| caoporn国产一区二区| 亚洲午夜久久久| 久久亚洲精品国产精品紫薇| 91在线观看美女| 日韩在线a电影| 国产精品久久久久久亚洲伦| 欧美理论电影在线| 成人做爰69片免费看网站| 亚洲国产精品一区二区久久| 久久精品日产第一区二区三区高清版| av不卡免费电影| 黄色资源网久久资源365| 亚洲免费在线电影| 久久亚洲综合色一区二区三区| 欧美自拍偷拍午夜视频| 国产米奇在线777精品观看| 亚洲自拍偷拍网站| 欧美激情综合在线| 欧美成人女星排行榜| 91久久一区二区| www.亚洲免费av| 精彩视频一区二区三区| 三级亚洲高清视频| 亚洲女子a中天字幕| 欧美国产1区2区| 精品国产一区二区亚洲人成毛片| 欧美视频一区二区在线观看| 成人蜜臀av电影| 国产精品白丝av| 美女网站视频久久| 首页亚洲欧美制服丝腿| 亚洲一区二区三区自拍| 18涩涩午夜精品.www| 国产三级精品三级在线专区| 久久影院午夜片一区| 在线成人午夜影院| 欧美日韩午夜在线| 91激情五月电影| 在线观看网站黄不卡| 91在线视频播放| 成人午夜电影网站| 国产不卡视频一区二区三区| 国产一区二区三区高清播放| 狠狠网亚洲精品| 国产一区二区主播在线| 久久99精品国产麻豆婷婷洗澡| 日韩av不卡在线观看| 丝袜美腿亚洲一区二区图片| 一区二区三区免费在线观看| 亚洲精品美腿丝袜| 一区二区日韩av| 亚洲午夜视频在线| 免费不卡在线观看| 韩国女主播成人在线| 国产成人av一区二区三区在线 | 99精品久久免费看蜜臀剧情介绍| 成人精品免费看| av在线一区二区| 91在线视频官网| 欧美日韩视频在线第一区 | 国产成人午夜精品影院观看视频 | 亚洲裸体在线观看| 亚洲午夜av在线| 日韩激情中文字幕| 久草精品在线观看| 成人av中文字幕| 欧美日韩亚洲综合在线| 精品乱人伦一区二区三区| 日本一区二区三区四区在线视频| 欧美激情一二三区| 午夜视频在线观看一区二区| 久久精品久久99精品久久| 欧美性大战久久| 日韩视频免费观看高清完整版| 精品国产欧美一区二区| 日本一二三不卡| 首页综合国产亚洲丝袜| 国产麻豆午夜三级精品| 色一情一乱一乱一91av| 日韩精品自拍偷拍| 亚洲欧洲三级电影| 日韩精品久久理论片| 国产福利91精品| 91精品综合久久久久久| 国产精品丝袜久久久久久app| 亚洲精品视频免费看| 九九视频精品免费| 一本到一区二区三区| 久久久久久久久久电影| 亚洲一二三专区| 国产成人一区二区精品非洲| 欧美精品xxxxbbbb| 亚洲区小说区图片区qvod| 激情欧美日韩一区二区| 欧美日韩成人一区| 亚洲女同ⅹxx女同tv| 国产精品资源在线看|