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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? restopeer.java

?? p2p 源代碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
                            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";    }    // This routine creates a Module Spec advertisement to be    // associated with a RestoPeer    private void createRestoPeerService() {        try {            // First create the Module class advertisement associated            // with the service.            // The Module class advertisement is used            // to advertise the existence of the service.            // In order to access the service, a            // peer will have to discover the associated module spec            // advertisement.            ModuleClassAdvertisement mcadv = (ModuleClassAdvertisement)                AdvertisementFactory.newAdvertisement(                ModuleClassAdvertisement.getAdvertisementType());            mcadv.setName("JXTAMOD:RestoNet:Service:" + brand);            mcadv.setDescription("RestoPeer service");            ModuleClassID mcID = IDFactory.newModuleClassID();            mcadv.setModuleClassID(mcID);            // Publish the Module Class advertisement            // it in my local cache and to my peergroup.            disco.publish(mcadv, DiscoveryService.ADV);            disco.remotePublish(mcadv, DiscoveryService.ADV);            // Create the Module Spec advertisement associated            // with the service.            // The Module Spec advertisement will contain            // all the information necessary for a client to contact            // the service; for instance it will contain a pipe            // advertisement to be used to contact the service            ModuleSpecAdvertisement mdadv = (ModuleSpecAdvertisement)                AdvertisementFactory.newAdvertisement(                ModuleSpecAdvertisement.getAdvertisementType());            // Set up some of the information field about the            // service. In this example, we set the name,            // provider and version and a pipe advertisement. The            // module creates an input pipes to listen on this pipe            // endpoint.            mdadv.setName("JXTASPEC:RestoNet:Service:" + brand);            mdadv.setVersion("Version 1.0");            mdadv.setCreator("sun.com");            mdadv.setModuleSpecID(IDFactory.newModuleSpecID(mcID));            mdadv.setSpecURI("http://www.jxta.org/tutorial/RestoPeer.jar");            // Set a pipe advertisement for the Service. The pipe is            // used as the mean to communicate with the service. The            // HungryPeer client MUST use this pipe to talk the            // service.            // The pipe advertisement is stored in the service advertisement            // params; the client retrieves it from the params.            mdadv.setPipeAdvertisement(myAdv);            // Display the advertisement as a plain text dcoument.            StructuredTextDocument doc = (StructuredTextDocument)                mdadv.getDocument(new MimeMediaType("text/plain"));            StringWriter out = new StringWriter();            doc.sendToWriter(out);            System.out.println(out.toString());            out.close();            // Publish the service advertisement            disco.publish(mdadv, DiscoveryService.ADV);            disco.remotePublish(mdadv, DiscoveryService.ADV);        } catch (Exception ex) {            System.out.println("Error publishing RestoPeer Advertisement");        }    }    // 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");            // get the discovery and pipe services for the RestoNet Peergroup            disco = restoNet.getDiscoveryService();            pipes = restoNet.getPipeService();            // check if I have already published myself            // one should always check if the advertisement            // is there            while (count-->0) {                try {                    // check first locally if we have the advertisement cached                    ae = disco.getLocalAdvertisements(DiscoveryService.ADV                                             , "name"                                             , "RestoNet:RestoPipe:"                                             + brand);                    // if we find our pipe advertisement we are done                    // no need to create one                    if (ae != null && ae.hasMoreElements()) {                        break;                    }                    // we did not find the advertisement locally, let's                    // send a remote request                    disco.getRemoteAdvertisements(null,			 DiscoveryService.ADV, "name",			 "RestoNet:RestoPipe:" + brand, 1, null);                    // nothing really to do here, so                    // wait a little to give a chance for the request                    // to come back                    try {                        Thread.sleep(timeout);                    } catch (Exception e){                    }                } catch (IOException e){                    // found nothing!  move on                }            }            // we searched for our pipe advertisement we could not find            // one so let's go an create one            if (ae == null || !ae.hasMoreElements()) {                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 sympolic name of the pipe is build from                // the brand name of RestoPeer. So each RestoPeer                // as a unique name.                myAdv.setName("RestoNet:RestoPipe:" + brand);                // set the type of the pipe                myAdv.setType(PipeService.UnicastType);                // we have the advertisement, we can publish                // our pipe advertisement into our local cache                // and to the RestoNet PeerGroup                disco.publish(myAdv, DiscoveryService.ADV);                disco.remotePublish(myAdv, DiscoveryService.ADV);                System.out.println("Created the Restaurant Pipe Advertisement");            } else {                // we got it so we do not need to create one                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;    }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区二区视频免费观看| 久久综合五月天婷婷伊人| 亚洲欧美色一区| www.日本不卡| 中文字幕在线观看不卡| 成人自拍视频在线| 欧美韩国一区二区| 成人午夜碰碰视频| 国产精品国产三级国产有无不卡| 国产成人在线观看免费网站| 久久精品亚洲精品国产欧美kt∨| 国产美女精品一区二区三区| 欧美大白屁股肥臀xxxxxx| 免费成人在线观看| xvideos.蜜桃一区二区| 精品无人区卡一卡二卡三乱码免费卡 | 99视频超级精品| 国产精品麻豆一区二区| 99久久精品国产毛片| 最新热久久免费视频| 色婷婷久久久久swag精品| 一区二区三区91| 欧美伦理影视网| 欧美a一区二区| 久久先锋资源网| 国产aⅴ综合色| 亚洲特黄一级片| 欧美日韩一级黄| 蜜臀a∨国产成人精品| wwwwww.欧美系列| 成人性生交大片免费看视频在线| 中文字幕亚洲欧美在线不卡| 色婷婷久久一区二区三区麻豆| 国产成人精品一区二| 欧美激情一区二区在线| 色88888久久久久久影院按摩| 亚洲一区二区偷拍精品| 91精品国产一区二区三区香蕉 | 日韩av不卡在线观看| 日韩欧美国产小视频| 国产麻豆一精品一av一免费 | 日韩电影在线观看网站| 久久久久国产成人精品亚洲午夜| caoporn国产一区二区| 伊人婷婷欧美激情| 日韩一级片在线观看| 大尺度一区二区| 亚洲制服丝袜av| 欧美成人在线直播| 成人app网站| 三级亚洲高清视频| 国产欧美精品在线观看| 色成人在线视频| 蜜桃一区二区三区在线| 亚洲国产成人自拍| 在线影院国内精品| 久草精品在线观看| 亚洲色图色小说| 91精品国产色综合久久| 国产.欧美.日韩| 午夜婷婷国产麻豆精品| 久久久久久97三级| 欧美视频精品在线| 国产乱国产乱300精品| 亚洲精品视频免费观看| 欧美xingq一区二区| 91原创在线视频| 人人狠狠综合久久亚洲| 自拍偷拍国产亚洲| 日韩欧美一级二级三级| 色哟哟一区二区三区| 久久不见久久见中文字幕免费| 亚洲国产精品成人综合色在线婷婷 | 美女视频一区在线观看| 18涩涩午夜精品.www| 欧美mv日韩mv国产网站| 欧美综合亚洲图片综合区| 国产精品一二三| 日韩高清一区在线| 亚洲男同1069视频| 国产亚洲欧美日韩日本| 欧美久久高跟鞋激| 92国产精品观看| 精品一区二区三区蜜桃| 亚洲高清免费观看| 亚洲视频在线一区| 久久精品男人的天堂| 91精品国产免费久久综合| 色呦呦网站一区| 成人小视频在线| 黄一区二区三区| 亚洲福利国产精品| 国产精品传媒入口麻豆| 久久久三级国产网站| 91精品国产福利| 在线精品视频免费播放| gogogo免费视频观看亚洲一| 久久99久久久久| 婷婷开心激情综合| 亚洲码国产岛国毛片在线| 久久久久国产成人精品亚洲午夜| 欧美一区二区三区四区在线观看| 色视频欧美一区二区三区| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 久久伊99综合婷婷久久伊| 欧美性猛片xxxx免费看久爱| 99久久99久久久精品齐齐| 丁香婷婷综合五月| 国产在线不卡一区| 免费成人av在线播放| 亚洲v日本v欧美v久久精品| 亚洲摸摸操操av| 国产精品丝袜一区| 国产亚洲精品bt天堂精选| 久久夜色精品国产噜噜av| 日韩三级视频中文字幕| 欧美伦理电影网| 欧美视频第二页| 欧美午夜宅男影院| 欧美色倩网站大全免费| 在线观看不卡一区| 91精彩视频在线| 欧洲精品视频在线观看| 色噜噜久久综合| 91国产精品成人| 91黄色激情网站| 欧美怡红院视频| 欧美日韩国产一级二级| 欧美专区在线观看一区| 欧美在线观看视频一区二区三区| 91福利国产成人精品照片| 91视频观看视频| 在线免费观看一区| 欧美中文字幕一二三区视频| 色菇凉天天综合网| 欧美性高清videossexo| 欧美日韩国产a| 91精品国产综合久久精品麻豆| 欧美在线免费观看亚洲| 欧美日韩第一区日日骚| 欧美一区二区三区在| 91精品国产综合久久精品麻豆| 日韩一区二区视频| 精品国产a毛片| 国产欧美日韩一区二区三区在线观看| 亚洲国产精品精华液ab| 亚洲欧美日本韩国| 亚洲一区二区三区国产| 天堂成人国产精品一区| 免费美女久久99| 国产在线精品一区二区三区不卡| 韩国av一区二区三区| 成熟亚洲日本毛茸茸凸凹| 94色蜜桃网一区二区三区| 欧美色精品天天在线观看视频| 7777精品伊人久久久大香线蕉完整版 | 最近中文字幕一区二区三区| 亚洲欧美激情一区二区| 一区二区三区免费看视频| 亚洲一区二区欧美激情| 日韩avvvv在线播放| 国产一区二区三区四区五区入口 | 久久视频一区二区| 中文文精品字幕一区二区| 亚洲天堂免费在线观看视频| 午夜精品一区在线观看| 精品一二线国产| 成人国产精品免费观看| 欧美色中文字幕| 久久久久99精品一区| 亚洲女同一区二区| 蜜乳av一区二区三区| 丰满白嫩尤物一区二区| 欧美色网一区二区| 久久天堂av综合合色蜜桃网| 亚洲美女屁股眼交| 捆绑变态av一区二区三区| 99久久伊人精品| 欧美日韩一区二区三区不卡| 精品成a人在线观看| 亚洲欧美乱综合| 久久成人免费网站| 一本大道综合伊人精品热热| 日韩欧美国产小视频| √…a在线天堂一区| 人人超碰91尤物精品国产| 成人高清视频免费观看| 91麻豆精品国产无毒不卡在线观看 | 国产精品女上位| 视频精品一区二区| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 欧洲国内综合视频| 久久久噜噜噜久久中文字幕色伊伊 | 国产精品短视频| 青娱乐精品视频| 色先锋aa成人| 欧美精品一区二区三| 亚洲国产一区二区三区青草影视| 国产福利不卡视频| 国产午夜精品一区二区三区四区 |