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

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

?? connection.java

?? 開放源碼的smpp協議開發包
?? JAVA
?? 第 1 頁 / 共 5 頁
字號:
/* * Java SMPP API * Copyright (C) 1998 - 2002 by Oran Kelly *  * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. *  * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU * Lesser General Public License for more details. *  * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA *  * A copy of the LGPL can be viewed at http://www.gnu.org/copyleft/lesser.html * Java SMPP API author: orank@users.sf.net * Java SMPP API Homepage: http://smppapi.sourceforge.net/ * $Id: Connection.java,v 1.23 2005/07/04 10:38:26 orank Exp $ */package ie.omk.smpp;import ie.omk.smpp.event.ConnectionObserver;import ie.omk.smpp.event.EventDispatcher;import ie.omk.smpp.event.ReceiverExceptionEvent;import ie.omk.smpp.event.ReceiverExitEvent;import ie.omk.smpp.event.ReceiverStartEvent;import ie.omk.smpp.event.SMPPEvent;import ie.omk.smpp.event.SimpleEventDispatcher;import ie.omk.smpp.message.Bind;import ie.omk.smpp.message.BindReceiver;import ie.omk.smpp.message.BindResp;import ie.omk.smpp.message.BindTransceiver;import ie.omk.smpp.message.BindTransmitter;import ie.omk.smpp.message.DeliverSM;import ie.omk.smpp.message.DeliverSMResp;import ie.omk.smpp.message.EnquireLink;import ie.omk.smpp.message.EnquireLinkResp;import ie.omk.smpp.message.InvalidParameterValueException;import ie.omk.smpp.message.SMPPPacket;import ie.omk.smpp.message.SMPPProtocolException;import ie.omk.smpp.message.SMPPRequest;import ie.omk.smpp.message.SMPPResponse;import ie.omk.smpp.message.Unbind;import ie.omk.smpp.message.UnbindResp;import ie.omk.smpp.message.tlv.Tag;import ie.omk.smpp.net.SmscLink;import ie.omk.smpp.net.TcpLink;import ie.omk.smpp.util.APIConfig;import ie.omk.smpp.util.AlphabetEncoding;import ie.omk.smpp.util.DefaultSequenceScheme;import ie.omk.smpp.util.PacketFactory;import ie.omk.smpp.util.PropertyNotFoundException;import ie.omk.smpp.util.SMPPIO;import ie.omk.smpp.util.SequenceNumberScheme;import ie.omk.smpp.version.SMPPVersion;import ie.omk.smpp.version.VersionException;import java.io.EOFException;import java.io.IOException;import java.net.SocketTimeoutException;import java.util.ArrayList;import java.util.Iterator;import org.apache.commons.logging.Log;import org.apache.commons.logging.LogFactory;/** * SMPP client connection (ESME). An SMPP Connection represents any kind of * connection to the SMSC, be it a transmitter, receiver or transceiver. It also * supports both synchronous and asynchronous modes of communication. * Synchronous mode is only useful for very simple applications that use * single-threading. Asynchronous mode is recommended for more complex * applications, especially those that will be running many threads. * <p> * <b>Important Note </b>: if you wish to use synchronous mode in a * multi-threaded environment, it is the <u>application's </u> responsiblity to * ensure there is only one thread executing a call to either or both of the * <code>sendRequest</code> and <code>readNextPacket</code> methods. If * there are concurrent calls to these methods executing, there is a strong * possibility of the incorrect packet being returned in a particular thread and * both the API and the application getting confused. These are the only methods * that contain such a race condition. * </p> *  * @author Oran Kelly * @version 1.0 */public class Connection implements java.lang.Runnable {    /** Get the logger for this Connection. */    protected Log logger = LogFactory.getLog(Connection.class);    /** SMPP Transmitter connection type. */    public static final int TRANSMITTER = 1;    /** SMPP Receiver connection type. */    public static final int RECEIVER = 2;    /** SMPP Transciever connection type. */    public static final int TRANSCEIVER = 3;    /** Connection state: not bound to the SMSC. */    public static final int UNBOUND = 0;    /**     * Connection state: waiting for successful acknowledgement to bind request.     */    public static final int BINDING = 1;    /** Connection state: bound to the SMSC. */    public static final int BOUND = 2;    /**     * Connection state: waiting for successful acknowledgement to unbind     * request or waiting for application to respond to unbind request.     */    public static final int UNBINDING = 3;    /** Type of this SMPP connection. */    private int connectionType = 0;    /** Packet listener thread for Asyncronous comms. */    private Thread rcvThread = null;    /**     * Queue of incoming packets to deliver to application before reading from     * the network. The queue is used only in syncrhonized mode. In the case     * where an application has sent a request to the SMSC and is blocked     * waiting a response and the SMSC initiates a request of it's own (an     * unbind request or an enquire_link), the API will cache the request packet     * and wait for the response to it's packet. Any other type of packet will     * be added to the packetQueue and subsequent calls to     * <code>readNextPacket</code> will clear this queue.     */    private ArrayList packetQueue = null;    /**     * Object used to notify observers of SMPP events.     */    private EventDispatcher eventDispatcher = null;    /** Byte buffer used in readNextPacketInternal. */    private byte[] buf = new byte[300];    /** Sequence numbering scheme to use for this connection. */    private SequenceNumberScheme seqNumScheme = new DefaultSequenceScheme();    /** The network link (virtual circuit) to the SMSC */    private SmscLink link = null;    /**     * SMPP protocol version number.     */    protected SMPPVersion interfaceVersion = SMPPVersion.getDefaultVersion();    /**     * Does the remote end support optional parameters? According to the     * SMPPv3.4 specification, if the SMSC does not return the     * sc_interface_version optional parameter in its bind response packet, then     * we must assume it does not support optional parameters.     */    protected boolean supportOptionalParams = true;    /**     * Current state of the SMPP connection. Possible states are UNBOUND,     * BINDING, BOUND and UNBINDING.     */    private int state = UNBOUND;    /**     * Specify whether the listener thread will automatically ack enquire_link     * primitives received from the Smsc     */    protected boolean ackQryLinks = true;    /**     * Automatically acknowledge incoming deliver_sm messages. Only valid for     * the Receiver     */    protected boolean ackDeliverSm = false;    /** Is the user using synchronous are async communication?. */    protected boolean asyncComms = false;    /**     * The default alphabet to use for this connection.     */    protected AlphabetEncoding defaultAlphabet = null;    /**     * Initialise a new SMPP connection object. This is a convenience     * constructor that will create a new {@link ie.omk.smpp.net.TcpLink}object     * using the host name and port provided. The connection created will use     * synchronous communications.     *      * @param host     *            the hostname of the SMSC.     * @param port     *            the port to connect to. If 0, use the default SMPP port     *            number.     */    public Connection(String host, int port)            throws java.net.UnknownHostException {        this(new TcpLink(host, port), false);    }    /**     * Initialise a new SMPP connection object. This is a convenience     * constructor that will create a new {@link ie.omk.smpp.net.TcpLink}object     * using the host name and port provided.     *      * @param host     *            the hostname of the SMSC.     * @param port     *            the port to connect to. If 0, use the default SMPP port     *            number.     * @param async     *            true for asyncronous communication, false for synchronous.     */    public Connection(String host, int port, boolean async)            throws java.net.UnknownHostException {        this(new TcpLink(host, port), async);    }    /**     * Initialise a new SMPP connection object. The connection will use     * synchronous communications.     *      * @param link     *            The network link object to the Smsc (cannot be null)     */    public Connection(SmscLink link) {        this(link, false);    }    /**     * Initialise a new SMPP connection object, specifying the type of     * communication desired. See the {@link Connection}class description for     * some required knowledge on using the Connection in syncrhonous mode.     *      * @param link     *            The network link object to the Smsc (cannot be null)     * @param async     *            true for asyncronous communication, false for synchronous.     */    public Connection(SmscLink link, boolean async) {        this.link = link;        this.asyncComms = async;        if (asyncComms) {            initAsyncComms();        } else {            initSyncComms();        }    }    private void initAsyncComms() {        String className = "";        try {            className = APIConfig.getInstance().getProperty(                    APIConfig.EVENT_DISPATCHER_CLASS);            if (className != null && !"".equals(className)) {                Class cl = Class.forName(className);                eventDispatcher = (EventDispatcher) cl.newInstance();            } else {                logger.info("EventDispatcher property value is empty.");            }        } catch (PropertyNotFoundException x) {            logger                    .debug("No event dispatcher specified in properties. Using default.");        } catch (ClassNotFoundException x) {            logger                    .error("Cannot locate event dispatcher class " + className,                            x);        } catch (Exception x) {            // Something wrong with the implementation.            StringBuffer errorMessage = new StringBuffer();            errorMessage.append("Event dispatcher implementation is ").append(                    "incorrect.\n").append(className).append(                    " should implement ie.omk.smpp.event.EventDispatcher ")                    .append("and have a default constructor.\n").append(                            "Falling back to default implementation after ")                    .append("receiving exception.");            logger.error(errorMessage.toString(), x);        } finally {            if (eventDispatcher == null)                eventDispatcher = new SimpleEventDispatcher();        }        // Initialise the event dispatcher        eventDispatcher.init();        // Create the receiver daemon thread.        createRecvThread();    }    private void initSyncComms() {        packetQueue = new ArrayList();    }    /**     * Create the receiver thread if asynchronous communications is on, does     * nothing otherwise.     */    private void createRecvThread() {        logger.info("Creating receiver thread");        rcvThread = new Thread(this, "ReceiverDaemon");        rcvThread.setDaemon(true);    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产在线精品一区二区不卡了| 国产精品亚洲一区二区三区妖精 | 欧美久久一二三四区| 91精品黄色片免费大全| 国产精品久久久久久福利一牛影视| 亚洲电影视频在线| 国产电影精品久久禁18| 91精品免费在线| 亚洲品质自拍视频| 国产91精品露脸国语对白| 欧美丰满少妇xxxxx高潮对白| 国产精品乱人伦| 国内成人免费视频| 欧美日韩免费电影| 亚洲美女电影在线| 成人av资源网站| 久久免费看少妇高潮| 七七婷婷婷婷精品国产| 一本在线高清不卡dvd| 国产亚洲精品久| 韩国女主播一区| 日韩一区二区免费在线电影| 亚洲一区二区三区自拍| 99久久综合狠狠综合久久| 久久午夜色播影院免费高清| 免费精品视频在线| 欧美一级午夜免费电影| 视频一区二区三区在线| 欧美日韩精品欧美日韩精品| 一区二区三区不卡视频在线观看| 成人丝袜高跟foot| 日本一区二区在线不卡| 成人免费电影视频| 国产亚洲欧美日韩日本| 精品一区二区在线免费观看| 日韩视频在线永久播放| 久草热8精品视频在线观看| 日韩一级片网址| 麻豆成人免费电影| 亚洲精品在线免费播放| 国产精品一二三四区| 久久精品视频一区二区| 久久蜜桃av一区二区天堂| 欧美一卡二卡三卡四卡| 日韩三级.com| 老汉av免费一区二区三区| 日韩欧美国产综合| 麻豆精品一区二区av白丝在线| 欧美一区二区大片| 激情综合色丁香一区二区| 国产欧美一区二区精品仙草咪| 国产一区二区在线看| 国产无遮挡一区二区三区毛片日本| 高清日韩电视剧大全免费| 18成人在线视频| 欧美日韩一区 二区 三区 久久精品 | 欧美一区二区三区系列电影| 美女www一区二区| 国产欧美一二三区| 在线观看91精品国产入口| 天堂成人国产精品一区| 精品粉嫩超白一线天av| av欧美精品.com| 天天综合色天天综合色h| 久久嫩草精品久久久精品| 99麻豆久久久国产精品免费优播| 亚洲成人自拍一区| 久久亚洲精品小早川怜子| 91色在线porny| 麻豆精品久久精品色综合| 中文字幕在线观看一区| 欧美一级搡bbbb搡bbbb| 成人免费不卡视频| 亚洲一区二区黄色| 久久久久久日产精品| 欧美无砖专区一中文字| 国产精品亚洲专一区二区三区| 亚洲黄色免费网站| 久久久久久9999| 欧美片在线播放| 97精品久久久久中文字幕| 免播放器亚洲一区| 亚洲男女一区二区三区| 亚洲精品一区二区三区在线观看| 91在线看国产| 麻豆精品视频在线| 一区二区三区蜜桃| 欧美www视频| 7799精品视频| 91小视频在线观看| 国产高清成人在线| 久久精品国产77777蜜臀| 亚洲自拍偷拍麻豆| 中文字幕一区二区三区蜜月| 久久久久国产精品人| 欧美一级一区二区| 91精品在线免费观看| 欧美在线观看一区| 97久久精品人人爽人人爽蜜臀| 国产激情一区二区三区四区| 久久91精品久久久久久秒播| 日韩国产在线观看| 亚洲va国产va欧美va观看| 亚洲中国最大av网站| 亚洲精品水蜜桃| 国产精品成人免费| 国产精品色眯眯| 国产婷婷精品av在线| 久久久99免费| 久久久久久久久久电影| 久久精品综合网| 国产亚洲精品7777| 国产欧美日韩另类视频免费观看| 亚洲精品在线一区二区| 精品久久人人做人人爰| 欧美大片一区二区| 337p日本欧洲亚洲大胆精品 | 欧美激情一区不卡| 国产色一区二区| 国产亚洲成av人在线观看导航| 精品国产乱码久久久久久影片| 制服.丝袜.亚洲.中文.综合| 3d动漫精品啪啪1区2区免费| 91精品午夜视频| 日韩欧美第一区| 久久精品一区二区三区不卡牛牛| 精品久久久久久久久久久久包黑料| 欧美一区二区三区在线观看 | 欧洲av一区二区嗯嗯嗯啊| 日本久久精品电影| 欧美丰满嫩嫩电影| 久久免费国产精品| 亚洲四区在线观看| 亚洲123区在线观看| 理论片日本一区| 国产成人免费视频网站高清观看视频| 懂色av一区二区三区蜜臀 | 国产成人av一区二区三区在线| 成人一区二区视频| 91理论电影在线观看| 欧美人妇做爰xxxⅹ性高电影| 亚洲精品一线二线三线| 亚洲日韩欧美一区二区在线| 亚洲国产裸拍裸体视频在线观看乱了 | 欧美日产国产精品| 欧美精品一区二区三区蜜桃视频| 中文在线一区二区| 亚洲天堂久久久久久久| 日韩精品乱码免费| 国产成a人无v码亚洲福利| 色综合天天综合网天天看片| 这里只有精品免费| 国产精品色在线观看| 日韩高清不卡一区二区| av中文字幕亚洲| 欧美一区二区三区免费观看视频 | 精品国产欧美一区二区| 亚洲天堂av老司机| 乱中年女人伦av一区二区| 91玉足脚交白嫩脚丫在线播放| 欧美肥胖老妇做爰| 国产精品久久久久久久久免费樱桃| 亚洲电影一区二区| av中文字幕一区| 久久众筹精品私拍模特| 亚洲chinese男男1069| 国产98色在线|日韩| 91精品国产色综合久久ai换脸| 国产精品国模大尺度视频| 久久97超碰国产精品超碰| 在线观看日韩精品| 国产精品国产三级国产普通话蜜臀| 蜜臀av性久久久久av蜜臀妖精| 91网站视频在线观看| 国产日产欧美一区二区视频| 日韩电影在线一区| 欧美在线色视频| 亚洲欧美激情一区二区| 懂色av一区二区三区免费看| 26uuu亚洲| 麻豆精品在线播放| 欧美卡1卡2卡| 亚洲国产美女搞黄色| 色综合久久九月婷婷色综合| 国产精品色哟哟| 国产精品538一区二区在线| 日韩欧美一区中文| 日韩在线卡一卡二| 欧美性猛交一区二区三区精品| 亚洲色图视频免费播放| 成人中文字幕在线| 国产欧美在线观看一区| 国产精品一级片在线观看| 久久久久久久久久久99999| 激情小说亚洲一区| 精品国产乱码久久久久久图片| 青青草国产精品亚洲专区无| 欧美日韩国产一区二区三区地区| 夜夜精品视频一区二区| 在线观看日韩毛片|