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

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

?? stunstack.java

?? stun的java實現
?? JAVA
字號:
/*
 * Stun4j, the OpenSource Java Solution for NAT and Firewall Traversal.
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package net.java.stun4j.stack;

import net.java.stun4j.message.Message;
import net.java.stun4j.StunException;
import net.java.stun4j.StunMessageEvent;
import net.java.stun4j.NetAccessPointDescriptor;
import java.net.DatagramSocket;

/**
 * The entry point to the Stun4J stack. The class is used to start, stop and
 * configure the stack.
 *
 * <p>Organisation: Louis Pasteur University, Strasbourg, France</p>
 *               <p>Network Research Team (http://www-r2.u-strasbg.fr)</p></p>
 * @author Emil Ivov
 * @version 0.1
 */
public class StunStack
{
    /**
     * We shouldn't need more than one stack in the same application.
     */
    private static StunStack stackInstance = null;

    /**
     * Our network gateway.
     */
    private NetAccessManager netAccessManager = new NetAccessManager();

    /**
     * The number of threads to split our flow in.
     */
    public static final int DEFAULT_THREAD_POOL_SIZE = 5;

    private StunProvider stunProvider = null;

    /**
     * Returns a reference to the singleton StunStack insance. If the stack
     * had not yet been initialised, a new instance will be created.
     *
     * @return a reference to the StunStack.
     */
    public static synchronized StunStack getInstance()
    {
        if (stackInstance == null)
            stackInstance = new StunStack();
        return stackInstance;
    }

    //----------------------- PUBLIC INTERFACE ---------------------------------
    /**
     * Puts the stack into an operational state.
     */
    public void start()
    {
        netAccessManager.start();
    }

    /**
     * Stops the stack. Tests have shown that on some OSes, it sometimes takes
     * a while for sockets to free their port and trying to bind to that port
     * immediately after gets us an exception. We therefore null the socket,
     * wait for 200 miliseconds and call the garbage collector this seems to be
     * working fine but is not what one could call neat behaviour, so if you'd
     * like to disable it - set the net.java.stun4j.stack.HARD_SOCK_CLOSE
     * property to anything different from true. If you'd want us to wait more
     * or less - set net.java.stun4j.stack.WAIT_FOR_SOCK_CLOSE to the
     * appropriate number of miliseconds.
     */
    public static void shutDown()
    {
        if (stackInstance == null)
            return;
        stackInstance.stunProvider.shutDown();
        stackInstance.netAccessManager.shutDown();

        stackInstance.netAccessManager = null;
        stackInstance.stunProvider = null;
        stackInstance = null;
    }

    public void setThreadPoolSize(int threadPoolSize)
        throws StunException
    {
        netAccessManager.setThreadPoolSize(threadPoolSize);
    }

    /**
     * Creates and starts the specified Network Access Point.
     *
     * @param apDescriptor A descriptor containing the address and port of the
     * STUN server that the newly created access point will communicate with.
     * @throws StunException
     *           <p>NETWORK_ERROR if we fail to create or bind the datagram socket.</p>
     *           <p>ILLEGAL_STATE if the stack had not been started.</p>
     */
    public void installNetAccessPoint(NetAccessPointDescriptor apDescriptor)
        throws StunException
    {
        checkStarted();

        netAccessManager.installNetAccessPoint(apDescriptor);
    }

    /**
     * Creates and starts the specified Network Access Point based on the specified
     * socket and returns a relevant descriptor.
     *
     * @param sock The socket that the new access point should represent.
     * @throws StunException
     *           <p>NETWORK_ERROR if we fail to create or bind the datagram socket.</p>
     *           <p>ILLEGAL_STATE if the stack had not been started.</p>
     * @return a descriptor of the newly created access point.
     */
   public NetAccessPointDescriptor installNetAccessPoint(DatagramSocket sock)
       throws StunException
   {
       checkStarted();

       return netAccessManager.installNetAccessPoint(sock);
   }


    /**
     * Stops and deletes the specified access point.
     * @param apDescriptor the access  point to remove
     */
    public void removeNetAccessPoint(NetAccessPointDescriptor apDescriptor)
        throws StunException
    {
        checkStarted();

        netAccessManager.removeNetAccessPoint(apDescriptor);
    }



    /**
     * Returns a StunProvider instance to be used for sending and receiving
     * mesages.
     *
     * @return an instance of StunProvider
     */
    public StunProvider getProvider()
    {
        return stunProvider;
    }

    //-------------------- internal stuff --------------------------------------
    /**
     * Private constructor as we want a singleton pattern.
     */
    private StunStack()
    {
        stunProvider = new StunProvider(this);

        netAccessManager.setEventHandler(getProvider());
    }

    /**
     * Throws a StunException.ILLEGAL_STATE if the stack had not been started.
     * @throws StunException ILLEGAL_STATE if the stack had not been started.
     */
    void checkStarted()
        throws StunException
    {
        if(!netAccessManager.isRunning())
            throw new StunException(
                        StunException.ILLEGAL_STATE,
                        "The stack needs to be started, for "
                        +"the requested method to work.");
    }

    /**
     * Returns the currently active instance of NetAccessManager.
     * @return the currently active instance of NetAccessManager.
     */
    NetAccessManager getNetAccessManager()
    {
        return netAccessManager;
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品综合一区二区| 亚洲麻豆国产自偷在线| 欧美国产亚洲另类动漫| 一区二区三区丝袜| 国产精品亚洲成人| 91精品黄色片免费大全| 亚洲欧美激情视频在线观看一区二区三区| 水野朝阳av一区二区三区| 99久久er热在这里只有精品15 | 国产三区在线成人av| 亚洲永久免费视频| 91猫先生在线| 国产精品久99| 成人久久视频在线观看| 久久香蕉国产线看观看99| 爽好久久久欧美精品| 欧美日韩一区二区三区视频| 欧美国产禁国产网站cc| 国产精品一区2区| 欧美精品一区二区在线观看| 麻豆国产精品官网| 制服丝袜亚洲网站| 偷拍亚洲欧洲综合| 欧美日韩国产综合一区二区三区 | 国产精品日韩成人| 成人听书哪个软件好| 国产拍欧美日韩视频二区| 激情六月婷婷久久| 日韩你懂的在线播放| 久久99热国产| 欧美精品一区二区三区四区| 国产一区在线不卡| 久久精品综合网| 风间由美性色一区二区三区| 久久欧美中文字幕| 成人在线视频一区二区| 国产农村妇女精品| 成人黄色电影在线| 亚洲精品国产视频| 欧美日韩久久久| 日韩电影在线免费看| 精品久久国产97色综合| 国产精品一区二区久久精品爱涩 | 亚洲亚洲精品在线观看| 欧美日高清视频| 日本欧美在线看| 久久久综合视频| 成人激情图片网| 一级中文字幕一区二区| 欧美二区乱c少妇| 狠狠色丁香婷婷综合| 中文字幕中文在线不卡住| 在线视频一区二区三区| 免费观看在线色综合| 国产日韩精品一区二区三区 | 亚洲国产成人av| 日韩免费电影网站| 丁香啪啪综合成人亚洲小说| 成人欧美一区二区三区白人 | 欧美午夜精品理论片a级按摩| 亚洲午夜日本在线观看| 精品国产麻豆免费人成网站| 99久久99久久综合| 久久成人免费日本黄色| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 亚洲欧美另类久久久精品| 欧美日本精品一区二区三区| 韩国av一区二区三区在线观看| 中文字幕在线观看不卡视频| 欧美日韩国产乱码电影| 从欧美一区二区三区| 亚洲18女电影在线观看| 国产欧美日韩不卡| 91精品中文字幕一区二区三区| 国产精品一卡二卡在线观看| 亚洲国产一区在线观看| 中文av一区二区| 日韩欧美第一区| 在线中文字幕一区| 成人精品国产免费网站| 蜜臂av日日欢夜夜爽一区| 亚洲欧美另类小说| 国产欧美一区二区三区在线看蜜臀| 欧美三级蜜桃2在线观看| 不卡视频在线看| 国产一区二区三区电影在线观看| 亚洲一区二区在线播放相泽| 国产精品欧美一级免费| 日韩欧美黄色影院| 欧美日韩电影在线播放| 色噜噜狠狠色综合欧洲selulu| 极品少妇xxxx精品少妇| 日韩—二三区免费观看av| 亚洲激情图片qvod| 亚洲色图欧洲色图| 国产偷国产偷精品高清尤物| 日韩欧美国产综合| 5566中文字幕一区二区电影 | 丁香网亚洲国际| 麻豆成人久久精品二区三区小说| 亚洲在线一区二区三区| 亚洲欧美日本韩国| 亚洲日本va在线观看| 国产欧美一区二区精品仙草咪| 日韩三级电影网址| 51久久夜色精品国产麻豆| 欧美性色aⅴ视频一区日韩精品| 成人精品一区二区三区四区| 国产综合色在线| 国产精品1区2区| 国模冰冰炮一区二区| 黄色小说综合网站| 捆绑紧缚一区二区三区视频| 免费成人在线观看视频| 久久精品国产亚洲aⅴ| 麻豆精品在线播放| 九九热在线视频观看这里只有精品| 日本中文一区二区三区| 奇米精品一区二区三区在线观看一 | 欧美国产日韩精品免费观看| 欧美激情在线一区二区三区| 中文字幕av一区二区三区免费看| 欧美国产禁国产网站cc| 亚洲素人一区二区| 亚洲最快最全在线视频| 婷婷综合五月天| 精品无人码麻豆乱码1区2区| 国产99久久久久久免费看农村| 成人动漫一区二区| 欧美在线制服丝袜| 欧美一区二区精美| 久久亚洲综合色| 中文字幕字幕中文在线中不卡视频| 亚洲婷婷在线视频| 午夜国产不卡在线观看视频| 蜜臀久久99精品久久久久久9| 国产美女精品在线| 91在线视频播放地址| 欧美日韩成人综合天天影院| 日韩欧美一区二区三区在线| 中文字幕av一区二区三区免费看| 亚洲精品第1页| 免费观看在线综合| 99久久免费国产| 日韩视频在线一区二区| 国产精品动漫网站| 日韩制服丝袜先锋影音| 高清beeg欧美| 欧美精品18+| 国产精品免费视频一区| 亚洲成人一区在线| 国产成人综合在线观看| 欧美日韩激情一区二区三区| 国产欧美精品一区二区色综合朱莉 | 国产乱子伦一区二区三区国色天香| 成人h动漫精品一区二区| 欧美群妇大交群的观看方式| 久久久精品中文字幕麻豆发布| 亚洲一区二区三区四区在线| 国产成人精品免费网站| 制服丝袜亚洲精品中文字幕| 亚洲欧洲av一区二区三区久久| 美女网站色91| 欧美性受xxxx| 亚洲人精品一区| 国产福利一区在线观看| 91精品在线观看入口| 国产精品看片你懂得| 久久国产精品露脸对白| 欧美日韩成人综合天天影院 | 国产精品免费人成网站| 久久精品国产一区二区三区免费看| 99久久伊人网影院| 久久伊人中文字幕| 日韩二区三区在线观看| 欧美午夜宅男影院| 日韩美女视频19| 99久久久无码国产精品| 亚洲国产成人一区二区三区| 极品少妇xxxx偷拍精品少妇| 日韩一区二区免费高清| 午夜精品久久久久久久久久久| 色综合久久久久综合| 国产精品久久久久久福利一牛影视 | 精品视频在线免费看| 亚洲欧美综合另类在线卡通| 国产91精品久久久久久久网曝门 | 成人晚上爱看视频| 国产日韩av一区| 国产精品1区2区| 国产喂奶挤奶一区二区三区| 国产伦精品一区二区三区免费迷| 日韩精品一区二区三区在线观看| 日韩国产在线观看| 欧美一区二区三区精品| 日本视频免费一区| 日韩视频一区在线观看| 麻豆精品精品国产自在97香蕉| 日韩午夜激情视频| 精品一区二区综合|