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

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

?? hungrypeer.java

?? p2p 源代碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
                // 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()) {                        restoPeerAdvs.addElement(ae.nextElement());                        ++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 advertisements                disco.getRemoteAdvertisements(null,                             DiscoveryService.ADV,                             "name", "RestoNet:RestoPipe:*", 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 + " RestoPeers(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;            }        }    }    private void authenticateAndJoin(PeerGroup pg) {        try {            StructuredDocument creds = null;            AuthenticationCredential authCred =                new AuthenticationCredential(pg, null, creds);            MembershipService m =                (MembershipService) pg.getMembershipService();            Authenticator auth = m.apply(authCred);            PasswdMembershipService.PasswdAuthenticator pwAuth =                (PasswdMembershipService.PasswdAuthenticator) auth;            String user = "hungrypeer";            String passwd = "password";            System.out.println("setting user to " + user + ":" + passwd);            pwAuth.setAuth1Identity(user);            pwAuth.setAuth2_Password(passwd);            if (!auth.isReadyForJoin()) {                System.err.println("Authentication failed");                throw new IllegalArgumentException("Can't authenticate");            }            m.join(auth);        } catch (Exception e) {            System.err.println("Authentication failed");            throw new IllegalArgumentException(e.toString());        }    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品国产三级国产普通话蜜臀| 日日摸夜夜添夜夜添亚洲女人| 亚洲黄色免费网站| 狠狠色综合日日| 91女人视频在线观看| 日韩欧美一区二区免费| 亚洲天堂网中文字| 精品在线免费视频| 欧美视频完全免费看| 国产精品毛片a∨一区二区三区 | 在线免费观看一区| 国产日韩精品一区二区三区在线| 日韩电影在线一区二区三区| 色婷婷久久一区二区三区麻豆| 精品国产人成亚洲区| 日韩精品国产精品| 欧美少妇性性性| 有码一区二区三区| 91免费在线视频观看| 国产精品国产三级国产aⅴ入口| 国产在线精品一区二区三区不卡| 欧美日韩成人在线| 亚洲一区免费观看| 91福利在线观看| 亚洲美女一区二区三区| 成人av资源站| 欧美激情综合五月色丁香| 精品一区二区国语对白| 日韩女优av电影| 国产资源精品在线观看| 26uuu色噜噜精品一区二区| 另类小说一区二区三区| 欧美电视剧在线观看完整版| 午夜成人在线视频| 91精品黄色片免费大全| 日日夜夜精品视频天天综合网| 欧美性三三影院| 亚洲大片精品永久免费| 欧美人体做爰大胆视频| 日韩国产一区二| 日韩一区二区在线观看| 精品一区二区在线看| 精品sm捆绑视频| 国产成人综合网站| 国产精品美女久久久久高潮| 91蜜桃网址入口| 尤物在线观看一区| 欧美一区二区视频在线观看2022 | 国产成人午夜精品5599| 久久精品人人做人人综合| 成人涩涩免费视频| 亚洲最大成人综合| 欧美精品粉嫩高潮一区二区| 久久成人免费网站| 中文av一区二区| 在线精品视频免费播放| 秋霞电影网一区二区| 精品久久国产字幕高潮| 国产99精品视频| 亚洲五月六月丁香激情| 精品乱码亚洲一区二区不卡| 99麻豆久久久国产精品免费优播| 亚洲卡通欧美制服中文| 精品久久久网站| 91小视频免费看| 久久9热精品视频| 中文字幕一区二区三区四区不卡| 欧美日韩卡一卡二| 国产成人自拍高清视频在线免费播放| 国产精品不卡在线观看| 制服.丝袜.亚洲.中文.综合| 国产精品123区| 五月综合激情日本mⅴ| 国产调教视频一区| 欧美体内she精高潮| 国产福利精品导航| 午夜在线电影亚洲一区| 亚洲国产精品传媒在线观看| 欧美三级视频在线| 成人午夜在线免费| 麻豆精品国产传媒mv男同| 亚洲欧美日韩中文播放 | 91福利在线看| 国产成人在线看| 天天操天天综合网| ...xxx性欧美| 久久亚洲私人国产精品va媚药| 日本久久电影网| 丁香五精品蜜臀久久久久99网站| 亚洲电影视频在线| 成人免费在线播放视频| www国产精品av| 欧美一区二区三区不卡| 色94色欧美sute亚洲线路一久| 国产精品白丝jk黑袜喷水| 日韩综合小视频| 亚洲自拍偷拍九九九| 国产精品天天摸av网| 欧美r级在线观看| 91精品国产综合久久福利软件 | 艳妇臀荡乳欲伦亚洲一区| 久久精品夜色噜噜亚洲aⅴ| 在线综合亚洲欧美在线视频| 欧美性大战久久久久久久蜜臀| 成人国产一区二区三区精品| 国产一区福利在线| 久久成人av少妇免费| 蜜臀99久久精品久久久久久软件| 图片区小说区国产精品视频| 亚洲国产精品视频| 亚洲国产精品久久人人爱| 亚洲黄网站在线观看| 一区二区三区日韩精品视频| 亚洲另类色综合网站| 伊人一区二区三区| 一个色在线综合| 亚洲一二三区在线观看| 亚洲国产日韩在线一区模特| 亚洲第一电影网| 日韩不卡在线观看日韩不卡视频| 午夜精品久久久久久不卡8050| 亚洲 欧美综合在线网络| 午夜视频在线观看一区| 日韩精品三区四区| 激情文学综合丁香| 国产成人午夜精品影院观看视频 | 欧美精品一区二区三区高清aⅴ| 欧美午夜寂寞影院| 欧美日韩精品综合在线| 91精品国产综合久久久久久久久久| 欧美精品免费视频| 日韩亚洲欧美在线观看| 亚洲精品一区在线观看| 国产欧美日韩久久| 亚洲视频免费在线观看| 亚洲一区二区三区四区中文字幕| 午夜视频在线观看一区| 麻豆精品在线播放| 99久久99久久综合| 99精品偷自拍| 欧美日韩成人高清| 久久女同精品一区二区| 国产精品久久久一区麻豆最新章节| 亚洲精品第一国产综合野| 日本午夜精品视频在线观看| 国产福利一区二区三区视频 | 91精品欧美一区二区三区综合在| 亚洲精品一区二区三区精华液| 欧美经典一区二区| 亚洲精品成人在线| 激情成人综合网| 欧美伊人精品成人久久综合97| 日韩欧美美女一区二区三区| 欧美国产精品v| 三级成人在线视频| av色综合久久天堂av综合| 欧美军同video69gay| 欧美国产精品劲爆| 蜜臀av亚洲一区中文字幕| 91浏览器在线视频| 久久久亚洲精品石原莉奈| 一区二区三区不卡视频| 国产精品夜夜爽| 91精品婷婷国产综合久久| 国产精品丝袜一区| 精品一区二区三区香蕉蜜桃| 色欧美乱欧美15图片| 国产视频一区在线观看| 日本伊人午夜精品| 色婷婷国产精品| 欧美激情综合五月色丁香小说| 日韩专区在线视频| 色悠悠久久综合| 亚洲国产精品成人综合色在线婷婷| 免费欧美日韩国产三级电影| 91美女精品福利| 国产欧美日本一区视频| 麻豆精品新av中文字幕| 欧美日韩成人综合在线一区二区 | 国产午夜亚洲精品理论片色戒| 亚洲成人福利片| 色av综合在线| 亚洲少妇中出一区| 成人国产电影网| 国产免费观看久久| 日本乱人伦一区| 欧美激情一区二区三区全黄| 麻豆极品一区二区三区| 91精品国产色综合久久久蜜香臀| 亚洲精品精品亚洲| 91免费小视频| 亚洲视频一二三区| 99精品在线观看视频| 亚洲丝袜美腿综合| av一本久道久久综合久久鬼色| 国产欧美日韩三区| 成人av小说网| 亚洲日本在线观看| 色婷婷久久久久swag精品| 亚洲女人的天堂|