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

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

?? tcpadv.java

?? jxta平臺的開發包
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* * Copyright (c) 2001-2006 Sun Microsystems, Inc.  All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in *    the documentation and/or other materials provided with the *    distribution. * * 3. The end-user documentation included with the redistribution, *    if any, must include the following acknowledgment: *       "This product includes software developed by the *       Sun Microsystems, Inc. for Project JXTA." *    Alternately, this acknowledgment may appear in the software itself, *    if and wherever such third-party acknowledgments normally appear. * * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must *    not be used to endorse or promote products derived from this *    software without prior written permission. For written *    permission, please contact Project JXTA at http://www.jxta.org. * * 5. Products derived from this software may not be called "JXTA", *    nor may "JXTA" appear in their name, without prior written *    permission of Sun. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED.  IN NO EVENT SHALL SUN MICROSYSTEMS OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of Project JXTA.  For more * information on Project JXTA, please see * <http://www.jxta.org/>. * * This license is based on the BSD license adopted by the Apache Foundation. * * $Id: TCPAdv.java,v 1.38 2006/05/30 20:53:51 hamada Exp $ */package net.jxta.impl.protocol;import java.util.Arrays;import java.util.Enumeration;import org.apache.log4j.Level;import org.apache.log4j.Logger;import net.jxta.document.Advertisement;import net.jxta.document.AdvertisementFactory;import net.jxta.document.Attributable;import net.jxta.document.Attribute;import net.jxta.document.Document;import net.jxta.document.Element;import net.jxta.document.MimeMediaType;import net.jxta.document.StructuredDocument;import net.jxta.document.XMLElement;import net.jxta.protocol.TransportAdvertisement;/** * Provides configuration parameters for the JXTA TCP Message Transport. */public class TCPAdv extends TransportAdvertisement {    /**     *  Log4J Logger     */    private static final Logger LOG = Logger.getLogger(TCPAdv.class.getName());    private static final String CONFIGMODES[] = { "auto", "manual" };    private static final String INDEXFIELDS[] = {/* none */};    private static final String PORT_ELEMENT = "Port";    private static final String ClientOffTag = "ClientOff";    private static final String ServerOffTag = "ServerOff";    private static final String MULTICAST_OFF_TAG = "MulticastOff";    private static final String FlagsTag = "Flags";    private static final String PublicAddressOnlyAttr = "PublicAddressOnly";    private String configMode = CONFIGMODES[0];    private String interfaceAddress = null;    private int startPort = -1;    private int listenPort = -1;    private int endPort = -1;    private String publicAddress = null;    private String multicastaddr = null;    private int multicastport = -1;    private int multicastsize = -1;    private boolean clientEnabled = true;    private boolean serverEnabled = true;    private boolean multicastEnabled = true;    private boolean publicAddressOnly = false;    /**     *  Our instantiator     */    public static class Instantiator implements AdvertisementFactory.Instantiator {        /**         * {@inheritDoc}         */        public String getAdvertisementType() {            return TCPAdv.getAdvertisementType();        }        /**         * {@inheritDoc}         */        public Advertisement newInstance() {            return new TCPAdv();        }        /**         * {@inheritDoc}         */        public Advertisement newInstance(net.jxta.document.Element root) {            return new TCPAdv(root);        }    }    /**     *  Returns the identifying type of this Advertisement.     *     *  <p/><b>Note:</b> This is a static method. It cannot be used to determine     *  the runtime type of an advertisment. ie.     *  </p><code><pre>     *      Advertisement adv = module.getSomeAdv();     *      String advType = adv.getAdvertisementType();     *  </pre></code>     *     *  <p/><b>This is wrong and does not work the way you might expect.</b>     *  This call is not polymorphic and calls     *  Advertiement.getAdvertisementType() no matter what the real type of the     *  advertisment.     *     * @return String the type of advertisement     */    public static String getAdvertisementType() {        return "jxta:TCPTransportAdvertisement";    }    /**     *  called only by instantiator     */    private TCPAdv() {}    /**     *  called only by instantiator     */    private TCPAdv(Element root) {        if (!XMLElement.class.isInstance(root)) {            throw new IllegalArgumentException(getClass().getName() + " only supports XLMElement");        }        XMLElement doc = (XMLElement) root;        String doctype = doc.getName();        String typedoctype = "";        Attribute itsType = doc.getAttribute("type");        if (null != itsType) {            typedoctype = itsType.getValue();        }        if (!doctype.equals(getAdvertisementType()) && !getAdvertisementType().equals(typedoctype)) {            throw new IllegalArgumentException("Could not construct : " + getClass().getName() + "from doc containing a " + doc.getName());        }        Attribute attr = doc.getAttribute(FlagsTag);        if (attr != null) {            String options = attr.getValue();            publicAddressOnly = (options.indexOf(PublicAddressOnlyAttr) != -1);        }        Enumeration elements = doc.getChildren();        while (elements.hasMoreElements()) {            XMLElement elem = (XMLElement) elements.nextElement();            if (!handleElement(elem)) {                if (LOG.isEnabledFor(Level.WARN)) {                    LOG.warn("Unhandled Element: " + elem);                }            }        }        // Sanity Check!!!        if (!Arrays.asList(CONFIGMODES).contains(configMode)) {            throw new IllegalArgumentException("Unsupported configuration mode.");        }        if ((listenPort < -1) || (listenPort > 65535)) {            throw new IllegalArgumentException("Illegal Listen Port Value");        }        if ((startPort < -1) || (startPort > 65535)) {            throw new IllegalArgumentException("Illegal Start Port Value");        }        if ((endPort < -1) || (endPort > 65535)) {            throw new IllegalArgumentException("Illegal End Port Value");        }        if ((0 == startPort) && (endPort != 0) || (0 != startPort) && (endPort == 0)) {            throw new IllegalArgumentException("Port ranges must both be 0 or non-0");        }        if ((-1 == startPort) && (endPort != -1) || (-1 != startPort) && (endPort == -1)) {            throw new IllegalArgumentException("Port ranges must both be -1 or not -1");        }        if ((null != publicAddress) && ((-1 != startPort) || (listenPort <= 0))) {            throw new IllegalArgumentException("Dynamic ports not supported with public address port forwarding.");        }        if (getMulticastState() && (null == getMulticastAddr())) {            throw new IllegalArgumentException("Multicast enabled and no address specified.");        }        if (getMulticastState() && (-1 == getMulticastPort())) {            throw new IllegalArgumentException("Multicast enabled and no port specified.");        }        if (getMulticastState() && ((getMulticastPort() <= 0) || (getMulticastPort() > 65536))) {            throw new IllegalArgumentException("Illegal Multicast Port Value");        }        if (getMulticastState() && (-1 == getMulticastSize())) {            throw new IllegalArgumentException("Multicast enabled and no size specified.");        }        if (getMulticastState() && ((getMulticastSize() <= 0) || (getMulticastSize() > 1048575L))) {            throw new IllegalArgumentException("Illegal Multicast datagram size");        }        // XXX 20050118 bondolo Some versions apparently don't initialize this field. Eventually make it required.        if( null == getProtocol() ) {            setProtocol( "tcp" );        }    }    /**     * {@inheritDoc}     */    public String getAdvType() {        return getAdvertisementType();    }    /**     * Returns the interface which the TCP transport will use.     *     * @return The interface to use. May be a DNS name or an IP Address.     */    public String getInterfaceAddress() {        return interfaceAddress;    }    /**     * Sets the interface which the TCP transport will use.     *     * @param ia The interface to use. May be a DNS name or an IP Address.     */    public void setInterfaceAddress(String ia) {        if (null != ia) {            ia = ia.trim();            if (0 == ia.length()) {                ia = null;            }        }        this.interfaceAddress = ia;    }    /**     * Returns the port on which the TCP Transport will listen if configured to     * do so. If a port range is specified then this the preference. Valid     * values are <code>-1</code>, <code>0</code> and <code>1-65535</code>.     * The <code>-1</code> value is used to signify that there is no port     * preference and any port in range will be used. The <code>0</code>     * specifies that the Socket API dynamic port allocation should be used.     * For values <code>1-65535</code> the value specifies the required port on     * which the TCP tranport will listen.     *     * @return the port     */    public int getPort() {        return listenPort;    }    /**     * Sets the port on which the TCP Transport will listen if configured to     * do so. If a port range is specified then this the preference. Valid     * values are <code>-1</code>, <code>0</code> and <code>1-65535</code>.     * The <code>-1</code> value is used to signify that there is no port     * preference and any port in range will be used. The <code>0</code>     * specifies that the Socket API dynamic port allocation should be used.     * For values <code>1-65535</code> the value specifies the required port on     * which the TCP tranport will listen.     *     * @param port the port on which to listen.     */    public void setPort(int port) {        listenPort = port;    }    /**     * Return the lowest port on which the TCP Transport will listen if     * configured to do so. Valid values are <code>-1</code>, <code>0</code> and     * <code>1-65535</code>. The <code>-1</code> value is used to signify that     * the port range feature should be disabled. The <code>0</code> specifies     * that the Socket API dynamic port allocation should be used. For values     * <code>1-65535</code> the value must be equal to or less than the value     * used for end port.     *     * @return the lowest port on which to listen.     */    public int getStartPort() {        return startPort;    }    /**     * Sets the lowest port on which the TCP Transport will listen if configured     * to do so. Valid values are <code>-1</code>, <code>0</code> and     * <code>1-65535</code>. The <code>-1</code> value is used to signify that     * the port range feature should be disabled. The <code>0</code> specifies     * that the Socket API dynamic port allocation should be used. For values     * <code>1-65535</code> the value must be equal to or less than the value     * used for end port.     *     * @param start the lowest port on which to listen.     */    public void setStartPort(int start) {        startPort = start;    }    /**     * Return the highest port on which the TCP Transport will listen if     * configured to do so. Valid values are <code>-1</code>, <code>0</code> and     * <code>1-65535</code>. The <code>-1</code> value is used to signify that     * the port range feature should be disabled. The <code>0</code> specifies     * that the Socket API dynamic port allocation should be used. For values     * <code>1-65535</code> the value must be equal to or greater than the value     * used for start port.     *     * @return the highest port on which to listen.     */    public int getEndPort() {        return endPort;    }    /**     * Sets the highest port on which the TCP Transport will listen if     * configured to do so. Valid values are <code>-1</code>, <code>0</code> and     * <code>1-65535</code>. The <code>-1</code> value is used to signify that     * the port range feature should be disabled. The <code>0</code> specifies     * that the Socket API dynamic port allocation should be used. For values     * <code>1-65535</code> the value must be equal to or greater than the value     * used for start port.     *     * @param end the highest port on which to listen.     */    public void setEndPort(int end) {        endPort = end;    }    /**     * Determine whether multicast if off or not     *     * @return boolean  current multicast state     */    public boolean getMulticastState() {        return multicastEnabled;    }    /**     * Enable or disable multicast.     *     * @param newState the desired state.     */    public void setMulticastState(boolean newState) {        multicastEnabled = newState;    }    /**     * returns the multicastaddr     *     * @return string multicastaddr     */    public String getMulticastAddr() {        return multicastaddr;    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲第一av色| 亚洲蜜臀av乱码久久精品| 日韩一区二区视频| 日韩免费看的电影| 亚洲国产精品t66y| 国产视频视频一区| 国产精品久久看| 亚洲影院久久精品| 免费成人在线影院| 成人午夜视频福利| 欧美日韩一本到| 亚洲自拍另类综合| 成人欧美一区二区三区1314| 中文字幕制服丝袜一区二区三区| 亚洲天堂免费看| 激情综合亚洲精品| 91久久线看在观草草青青| 日韩一区二区视频| 国产精品久久二区二区| 五月综合激情网| 国产91丝袜在线18| 日韩精品一区二区三区视频在线观看| 精品99久久久久久| 视频一区二区中文字幕| 97久久精品人人澡人人爽| 欧美成人bangbros| 亚洲成人精品影院| 99精品欧美一区二区蜜桃免费| 884aa四虎影成人精品一区| 国产精品久久久久7777按摩 | 亚洲美女免费在线| 国产成人av福利| 欧美v日韩v国产v| 久久精品国产精品亚洲精品| 欧洲国产伦久久久久久久| 亚洲免费看黄网站| a亚洲天堂av| 国产色综合一区| 国产精品亚洲第一| 中文字幕一区二区三区在线观看| 国产成人在线视频免费播放| 久久免费美女视频| 韩日精品视频一区| 欧美一区二区三区精品| 亚洲一区二区三区四区五区黄| 在线中文字幕一区| 午夜天堂影视香蕉久久| 日韩女同互慰一区二区| 国产乱人伦偷精品视频不卡 | 国产一区二区三区免费看| www久久精品| 成人午夜看片网址| 亚洲综合免费观看高清完整版 | 久久99精品久久久久| 精品剧情在线观看| www.99精品| 日韩**一区毛片| 国产欧美久久久精品影院| 一本色道久久综合亚洲91| 亚洲chinese男男1069| 国产欧美1区2区3区| 91在线精品一区二区| 免费观看日韩电影| 中文字幕欧美国产| 欧美日韩成人综合| 韩国成人在线视频| 91在线无精精品入口| 亚洲欧美一区二区久久 | 亚洲欧美在线视频| 91精品国产入口| jizzjizzjizz欧美| 麻豆一区二区三区| 亚洲一区二区三区四区中文字幕| 欧美精品一区二区三区高清aⅴ| 欧美午夜影院一区| aaa亚洲精品一二三区| 久久99热国产| 麻豆国产欧美日韩综合精品二区| 亚洲一区二区不卡免费| 综合久久久久久久| 国产精品久久久久久久久免费相片| 91麻豆精品91久久久久久清纯| 99久久精品久久久久久清纯| 国产成人精品免费在线| 韩国三级在线一区| 国产成人精品一区二区三区四区| 六月丁香综合在线视频| 蜜臀99久久精品久久久久久软件| 午夜视频一区二区| 日本va欧美va欧美va精品| 日本欧美一区二区| 午夜精品久久久久久久蜜桃app| 一区二区视频在线| 日韩精品欧美精品| 国产精品18久久久久久久久久久久| 卡一卡二国产精品| 岛国一区二区在线观看| 91免费精品国自产拍在线不卡| 91视频精品在这里| 欧美一二区视频| 国产精品三级视频| 亚洲成av人片在线| 精品一区二区三区久久久| 99国产精品久久久久| 欧美日韩视频专区在线播放| 亚洲精品在线网站| 亚洲综合久久久久| 国产成人免费视频精品含羞草妖精 | 亚洲国产成人av好男人在线观看| 精品一区二区三区视频| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 激情小说亚洲一区| 欧美日韩中文另类| 国产精品久久久久久久久搜平片 | 欧美日韩国产一级| 日本一区二区三区久久久久久久久不| 玉米视频成人免费看| 国产不卡一区视频| 精品久久久久久久久久久院品网| 亚洲少妇最新在线视频| 国产成人综合亚洲91猫咪| 日韩午夜av电影| 亚洲成人一区二区| 色噜噜久久综合| 国产精品免费观看视频| 久久久国际精品| 亚洲一区二区三区四区五区黄| 国产一区二区免费看| 欧美日韩亚州综合| 日韩精品成人一区二区三区| 欧美日韩免费电影| 视频一区中文字幕国产| 欧美一区二区久久| 三级一区在线视频先锋 | 日韩专区在线视频| 91.麻豆视频| 国产真实乱子伦精品视频| 日韩一区二区三区观看| 风间由美性色一区二区三区| 欧美一区二区播放| 国精产品一区一区三区mba桃花| 国产欧美一区二区在线| 99久久精品国产网站| 亚洲二区在线观看| 精品国产一区二区在线观看| 国产成a人亚洲精品| 一级特黄大欧美久久久| 日韩亚洲欧美在线| 成人丝袜高跟foot| 亚洲国产va精品久久久不卡综合| 日韩视频在线你懂得| 99久久国产综合精品色伊| 香蕉乱码成人久久天堂爱免费| 久久综合色综合88| 欧美精品精品一区| 成人激情文学综合网| 青椒成人免费视频| 综合婷婷亚洲小说| 久久久久久久久久久久电影| 日本福利一区二区| 国产成人精品免费在线| 麻豆freexxxx性91精品| 亚洲综合色噜噜狠狠| 亚洲国产成人自拍| 国产欧美日韩视频在线观看| 日韩欧美一级片| 日韩精品中文字幕在线一区| 在线观看www91| 精品视频1区2区3区| 日本韩国一区二区三区视频| k8久久久一区二区三区| 国产精品一区二区不卡| 狠狠色丁香婷婷综合| 韩日欧美一区二区三区| 九一九一国产精品| 国产高清在线观看免费不卡| 国产一区二区三区最好精华液| 久久精品国产亚洲a| 激情图区综合网| 成人亚洲一区二区一| 91麻豆自制传媒国产之光| 国产大片一区二区| 国产精品综合一区二区| 国产a视频精品免费观看| av资源站一区| 欧洲一区在线观看| 日韩免费高清视频| 日本一区二区视频在线| 亚洲特级片在线| 丝袜a∨在线一区二区三区不卡| 亚洲国产精品一区二区久久| 男女性色大片免费观看一区二区| 免费看欧美女人艹b| 岛国精品一区二区| 欧美丰满少妇xxxxx高潮对白| 久久亚洲捆绑美女| 亚洲国产综合91精品麻豆| 久久99蜜桃精品| 日本高清不卡视频| 久久久久久免费|