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

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

?? restopeer.java

?? 冒險島游戲的flash版本的函數
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
import java.io.*;import java.net.*;import java.util.*;import net.jxta.peergroup.PeerGroup;import net.jxta.peergroup.PeerGroupID;import net.jxta.peergroup.PeerGroupFactory;import net.jxta.exception.PeerGroupException;import net.jxta.document.AdvertisementFactory;import net.jxta.document.StructuredDocumentFactory;import net.jxta.document.Advertisement;import net.jxta.document.Element;import net.jxta.document.MimeMediaType;import net.jxta.document.StructuredDocument;import net.jxta.discovery.DiscoveryService;import net.jxta.id.IDFactory;import net.jxta.pipe.PipeService;import net.jxta.pipe.InputPipe;import net.jxta.pipe.OutputPipe;import net.jxta.pipe.PipeID;import net.jxta.protocol.PipeAdvertisement;import net.jxta.protocol.PeerGroupAdvertisement;import net.jxta.protocol.ModuleImplAdvertisement;import net.jxta.endpoint.Message;import net.jxta.id.IDFactory;// RestoPeer represents a restaurant that receives auction requests// for french fries from HungryPeers. RestoPeers offers three sizes of// french fries (small, large, medium). Each restaurant assignes a// different price to each size. Each restaurant also offers a special// offering.//// Each restaurant is uniquely identified by its brand name.public class RestoPeer {    private PeerGroup netpg = null;      // The NetPeerGroup    private PeerGroup restoNet = null;   // The restoNet Peergroup    private String brand = "Chez JXTA";        // Brand of this restaurant    private String specials = "large ($3.00)"; // Current restaurant special    // Services within the RestoNet peergroup    private DiscoveryService disco = null;  // Discovery service    private PipeService pipes = null;       // Pipe service    private PipeAdvertisement myAdv = null; // My RestoPeer pipe advertisement    private InputPipe pipeIn = null;        // Input pipe that we listen to                                            // for requests from Hungry Peers    private int timeout = 3000;          // discovery wait timeout    private int rtimeout = 8000;         // resolver pipe timeout    static String groupURL = "jxta:uuid-4d6172676572696e204272756e6f202002";     public static void main(String args[]) {        RestoPeer myapp = new RestoPeer();        myapp.startJxta();        System.exit(0);    }    // Method to start the JXTA platform, join the RestoNet peergroup and    // advertise the RestoPeer service    private void startJxta() {        try {            //Discover and join (or start) the default peergroup            netpg = PeerGroupFactory.newNetPeerGroup();        } catch (PeerGroupException e) {            //Couldn't initialize; can't continue            System.out.println("Fatal error : creating the NetPeerGroup");            System.exit(1);        }        // Discover (or create) and join the RestoNet peergroup        try {            joinRestoNet();        } catch (Exception e) {            System.out.println("Can't join or create RestoNet");            System.exit(1);        }        // Discover (or create) and publish a RestoPeer pipe to receive        // auction request for fries from HungryPeers        if (!createRestoPipe()) {            System.out.println("Aborting due to failure to create RestoPeer pipe");            System.exit(1);        }        // Start the RestoPeer server loop to respond to Hungry peers        // fries requests.        handleFriesRequest();    }    // Discover (or create) and join the RestoNet peergroup    private void joinRestoNet() throws Exception {        int count = 3;   // maximun number of attempts to discover        System.out.println("Attempting to Discover the RestoNet PeerGroup");        // Get the discovery service from the NetPeergroup        DiscoveryService hdisco = netpg.getDiscoveryService();        Enumeration ae = null;   // Holds the discovered peers        // Loop until wediscover the RestoNet or        // until we've exhausted the desired number of attempts        while (count-- > 0) {            try {                // search first in the peer local cache to find                // the RestoNet peergroup advertisement                ae = hdisco.getLocalAdvertisements(DiscoveryService.GROUP,                                          "Name", "RestoNet");                // If we found the RestoNet advertisement we are done                if ((ae != null) && ae.hasMoreElements())                    break;                // If we did not find it, we send a discovery request                hdisco.getRemoteAdvertisements(null,                       DiscoveryService.GROUP, "Name", "RestoNet", 1, null);                // Sleep to allow time for peers to respond to the                // discovery request                try {                    Thread.sleep(timeout);                } catch (InterruptedException ie) {}            } catch (IOException e){                // Found nothing! Move on            }        }        PeerGroupAdvertisement restoNetAdv = null;        // Check if we found the RestoNet advertisement.        // If we didn't, then either        //       we are the first peer to join or        //       no other RestoNet peers are up.        // In either case, we must create the RestoNet peergroup        if (ae == null || !ae.hasMoreElements()) {            System.out.println(                 "Could not find the RestoNet peergroup; creating one");            try {                // Create a new, all-purpose peergroup.                ModuleImplAdvertisement implAdv =                    netpg.getAllPurposePeerGroupImplAdvertisement();                restoNet = netpg.newGroup(                                mkGroupID(),      // Assign new group ID                                implAdv,          // The implem. adv                                "RestoNet",       // Name of peergroup                                "RestoNet, Inc.");// Description of peergroup                // Get the PeerGroup Advertisement                restoNetAdv = netpg.getPeerGroupAdvertisement();            } catch (Exception e) {                System.out.println("Error in creating RestoNet Peergroup");                throw e;            }        } else {            // The RestoNet advertisement was found in the cache;            // that means we can join the existing RestoNet peergroup            try {                restoNetAdv = (PeerGroupAdvertisement) ae.nextElement();                restoNet = netpg.newGroup(restoNetAdv);                System.out.println(                    "Found the RestoNet Peergroup advertisement");            } catch (Exception e) {                System.out.println("Error in creating RestoNet PeerGroup from existing adv");                throw e;            }        }        try {            // Get the discovery and pipe services for the RestoNet Peergroup            disco = restoNet.getDiscoveryService();            pipes = restoNet.getPipeService();        } catch (Exception e) {            System.out.println("Error getting services from RestoNet");            throw e;        }        System.out.println("RestoNet Restaurant (" + brand + ") is on-line");        return;    }    // Method to handle fries auction requests from HungryPeers.    // The method waits for HungryPeer requests pipe messages to arrive.    // Incoming requests contain a pipe advertisement to respond to    // the HungryPeers requester and a fries size.  The method    // generates a bid offer for the request, opens an output pipe to    // the HungryPeer requester, and send the response.    private void handleFriesRequest() {        InputStream ip = null;               // Input Stream to read message        PipeAdvertisement hungryPipe = null; // HungryPeer Requester pipe        StructuredDocument request = null;   // Request document        StructuredDocument bid = null;       // Response document        // Document mime types        MimeMediaType mimeType = new MimeMediaType("text", "xml");        Element el = null;                   // Element in document        String name = null;                  // Name of the sender        String size = null;                  // Fries size Requested        OutputPipe pipeOut = null;           // Output pipe to respond to                                             // HungryPeer requester        System.out.println("RestoNet Restaurant (" + brand +                           ") waiting for HungryPeer requests");        // Loop waiting for HungryPeer Requests        while (true) {            Message msg = null;          // Incoming pipe message            try {                // Block until a message arrive on the RestoPeer pipe                msg = pipeIn.waitForMessage();                // If message is null discard message                if (msg == null) {                   if (Thread.interrupted()) {                        // We have been asked to stop                        System.out.println("Abort: RestoPeer interrupted");                        return;                    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美视频精品在线观看| 国产网站一区二区| 国产电影一区二区三区| 欧美亚洲国产一区二区三区| 精品国产伦一区二区三区观看体验| 成人免费视频视频| 欧美色成人综合| 夜夜亚洲天天久久| 91污在线观看| 1区2区3区欧美| 成人av资源在线观看| 国产性天天综合网| 97aⅴ精品视频一二三区| 中文字幕精品三区| 色综合久久综合中文综合网| 一区二区免费看| 91精品国产色综合久久ai换脸 | 久久婷婷成人综合色| 蜜臀av一级做a爰片久久| 欧美精品在线一区二区三区| 香蕉久久一区二区不卡无毒影院| 欧美亚洲国产一卡| 美女视频黄免费的久久 | 亚洲成a人片综合在线| 91精品在线一区二区| 久久成人18免费观看| 亚洲国产精品成人久久综合一区 | 亚洲色图在线视频| 在线电影欧美成精品| www.日韩大片| 色久综合一二码| 日产国产高清一区二区三区| 欧美成人一级视频| 91在线云播放| 国产一区二区中文字幕| 午夜欧美电影在线观看| 国产日产欧美一区二区三区| 欧美主播一区二区三区| 日韩电影在线免费| 亚洲色图色小说| 久久亚洲一区二区三区四区| 色婷婷精品大在线视频| 亚洲国产日韩a在线播放性色| 亚洲成人精品在线观看| 18成人在线观看| 亚洲国产精品传媒在线观看| 日韩一区二区精品在线观看| 欧美婷婷六月丁香综合色| av男人天堂一区| 高清成人免费视频| 国产一区二区主播在线| 日韩国产一区二| 久草热8精品视频在线观看| 日本系列欧美系列| 卡一卡二国产精品| 麻豆精品久久精品色综合| 日日夜夜免费精品视频| 亚洲一区二区在线免费看| 久久伊99综合婷婷久久伊| 日韩欧美中文字幕精品| 7777精品伊人久久久大香线蕉经典版下载 | 免费av成人在线| 亚洲成av人**亚洲成av**| 久久亚洲欧美国产精品乐播 | 欧美日韩国产一二三| 欧美精品欧美精品系列| 欧美一区二区视频免费观看| 精品免费一区二区三区| 日韩欧美综合在线| 久久久亚洲精华液精华液精华液| 欧美mv和日韩mv国产网站| 久久综合av免费| 亚洲男同性视频| 久久99精品久久久久久国产越南| 九色综合狠狠综合久久| 成人免费毛片app| 日本道在线观看一区二区| 制服丝袜日韩国产| 久久―日本道色综合久久| 亚洲欧美色一区| 麻豆精品视频在线观看免费| 97se亚洲国产综合在线| 自拍偷拍亚洲激情| 久久精品国产精品亚洲红杏 | 一区二区在线免费观看| 理论电影国产精品| 在线观看欧美精品| 久久精品视频在线免费观看| 亚洲视频一区在线| 成人黄色综合网站| 精品国产3级a| 丝袜亚洲另类欧美| 成人av动漫网站| 久久精品亚洲一区二区三区浴池| 亚洲精品成人在线| 粉嫩高潮美女一区二区三区| 欧美精品免费视频| 五月综合激情网| 欧美久久久久免费| 一区二区欧美精品| 欧美精品日韩精品| 亚洲一区二区三区国产| 粉嫩蜜臀av国产精品网站| 日韩你懂的电影在线观看| 日韩不卡一二三区| 精品久久久久香蕉网| 久草在线在线精品观看| 日韩午夜精品电影| 美女任你摸久久| 欧美一级夜夜爽| 日韩电影在线观看网站| 亚洲精品在线三区| 国产成人精品三级| 中文字幕免费不卡| 日本久久一区二区| 视频一区二区国产| 5月丁香婷婷综合| 麻豆成人综合网| 国产欧美日韩精品一区| www.欧美色图| 视频一区二区三区入口| 日韩一区二区三区电影| 成人看片黄a免费看在线| 国产精品的网站| 欧美日韩你懂得| 高清在线不卡av| 婷婷成人综合网| 中文乱码免费一区二区 | 亚洲免费资源在线播放| 欧美日韩一区三区| 精品一区二区三区视频在线观看| 日韩码欧中文字| 欧美猛男超大videosgay| 成人免费看的视频| 日韩制服丝袜av| 亚洲国产精品嫩草影院| 久久亚洲精精品中文字幕早川悠里| 国产精品亚洲午夜一区二区三区| 一区二区三区四区激情| 精品欧美一区二区在线观看 | 激情综合色播五月| 首页国产欧美日韩丝袜| 国产精品三级av| 欧美www视频| 欧美日韩高清一区二区不卡| 成人黄页在线观看| 成人免费高清在线| 国内精品伊人久久久久av影院| 奇米影视在线99精品| 午夜伦理一区二区| 日韩成人一区二区三区在线观看| 亚洲综合自拍偷拍| 五月天激情小说综合| 午夜精品免费在线观看| 日韩国产欧美三级| 久久国产精品一区二区| 久久国产精品免费| 韩国精品一区二区| 国产福利精品导航| 福利一区福利二区| 在线观看视频一区二区| 91麻豆精品国产91久久久久 | 懂色中文一区二区在线播放| 国产成人自拍高清视频在线免费播放| 精品亚洲国内自在自线福利| 成人小视频免费在线观看| 91在线免费看| 日韩一级完整毛片| 国产亚洲欧美在线| 中文字幕视频一区| 免费在线看一区| 播五月开心婷婷综合| 欧美日韩在线三级| 欧美tk丨vk视频| 亚洲女爱视频在线| 国产一区二区视频在线播放| 91国在线观看| 国产日韩欧美不卡| 免费在线观看一区二区三区| 成人精品视频一区二区三区| 日韩一区二区三区视频| 一区二区三区国产豹纹内裤在线| 久久不见久久见免费视频7| 91丝袜美腿高跟国产极品老师| 久久免费的精品国产v∧| 亚洲综合在线视频| 97超碰欧美中文字幕| 久久亚洲二区三区| 亚洲视频香蕉人妖| 国产999精品久久久久久| 日本一区二区三区高清不卡| 91麻豆国产自产在线观看| 亚洲国产精品一区二区www| 这里只有精品99re| 韩国av一区二区| 18成人在线视频| 91精品国产aⅴ一区二区| 国产99精品在线观看| 亚洲成a人片综合在线| 中文字幕欧美三区|