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

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

?? cwtpinitiator.java

?? jwap 協(xié)議 udp 可以用于手機(jī)通訊
?? JAVA
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/** * JWAP - A Java Implementation of the WAP Protocols * Copyright (C) 2001-2004 Niko Bender * * 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 */package net.sourceforge.jwap.wtp;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.io.ByteArrayOutputStream;import java.io.IOException;import java.util.Random;import net.sourceforge.jwap.util.Logger;import net.sourceforge.jwap.wtp.pdu.CWTPAbort;import net.sourceforge.jwap.wtp.pdu.CWTPAck;import net.sourceforge.jwap.wtp.pdu.CWTPInvoke;import net.sourceforge.jwap.wtp.pdu.CWTPPDU;import net.sourceforge.jwap.wtp.pdu.CWTPResult;import net.sourceforge.jwap.wtp.pdu.CWTPSegmResult;import net.sourceforge.jwap.wtp.pdu.EWTPCorruptPDUException;/** * This class implements a WTP state machine of one transaction according * to the WTP specification by the WAP Forum. It uses CWTPManagement to send * the PDUs. CWTPManagement receives PDUs from the remote, decodes them and * calls #process(CWTPPDU pdu) of the corresponding tranaction (this class). * <p> * To be informed of thrown service primitives by this layer, you should * implement the interface IWTPUpperLayer and give it with the constructor. * </p><p> * To construct a service primitive to be processed by this WTP-socket, * use objects of the class CWTPEvent, that implement service primitives. * </p><p> * To Use a whole WAP Stack besides you need the WSP layer, implemented * in package mmsjua.wap.wsp. * </p><p> * <b>Notice</b>, that development is actually in progress. * Most features are implemented but only for Initiator, not for a responder! * (for a definition of these terms refer to the spec, section 3.2.) * </p><p> * <b>Section descriptions</b> used in this class refer to * WTP Specification WAP-224-WTP-20010710-a * by the <a href="http://www.wapforum.org">WAP Forum</a> * </p> * */public class CWTPInitiator implements IWTPTransaction {    private static final byte STATE_NULL = 0x00;    private static final byte STATE_RESULT_WAIT = 0x01;    private static final byte STATE_RESULT_RESP_WAIT = 0x02;    private static final byte STATE_WAIT_TIMEOUT = 0x03;    private static final byte STATE_WAIT_ACK = 0x04;    private static final String[] states = {        "NULL", "RESULT WAIT", "RESULT RESP WAIT", "WAIT TIMEOUT", "WAIT ACK"    };    protected static Logger logger = Logger.getLogger(CWTPInitiator.class);    public static final int RCR_MAX = 3;    public static final int AEC_MAX = 3;    /**     * 9.4.3     * counter to generate unique TIDs     * uint16     */    private static int genTID = -1;    private byte state = 0x00;    // which session does this transaction belong to?    private IWTPUpperLayer upperLayer;    // used to send and receive    private CWTPSocket wtpSocket;    // is this transaction aborted?    private boolean aborted = false;    private short abortCode;    /**     * 5.3.1.7     * Class Type 1, 2 or 3     */    private byte classType;    /**     * 9.4.1     * ack interval     * this sets a bound for the amount of time to wait before sending an acknowledgement.     */    private javax.swing.Timer a_timer;    private int a = 5000;    /**     * 9.4.1     * retry interval     * This sets a bound for the amount of time to wait before re-transmitting a PDU.     */    private javax.swing.Timer r_timer;    private int r = 10000;    /**     * 9.4.1     * wait timeout interval (only class 2 initiator and class 1 responder)     * This sets a bound for the amount of time to wait before state information     * about a transaction is released.     */    private javax.swing.Timer w_timer;    private int w = 5000;    /**     * 7.14.3     * While segmentation each segment has to be acknowledged. This timer     * waits before resending a segment.     */    private javax.swing.Timer s_timer;    private int s = 5000;    private CWTPPDU segment;    private int segment_sended = 1;    private final int segment_sended_max = 4;    /**     * 9.4.2     * re-transmission counter     * acknowledgement expireation counter     */    private int rcr = 0;    private int aec = 0;    /**     * uint16     */    private int sendTID;    private int rcvTID;    private int lastTID;    /**     * recently sent PDU - hold it for retransmission     */    private CWTPPDU sentPDU;    private boolean holdOn = false;    private boolean uack = false;    /**     * next segment to send while in STATE_WAIT_ACK     */    private int segmentIndex = 0;    private ByteArrayOutputStream segdata;    private int segend;    private short seglast;    private int segTID;    //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX    //XXXXXXXXXXXXXXXXXXXXXXX CONSTRUCTOR XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX    /**     * Constructs a CWTPSocket using a DatagramSocket (UDP).     * Even implementing all parameters belonging to according to     * TR-Invoke service primitive (section 5.3.1),     * which are not temporary for one transaction.     * This socket can be used several times by service primitives.     * After all it has to be closed by calling <code>close()</code>     *     * @see #close(short)     * @param to destination address (section 5.3.1.3)     * @param port destination port (section 5.3.1.4)     * @param ackType Ack Type (section 5.3.1.5)     * @param classType Class Type (0, 1 or 2) (section 5.3.1.8)     * @throws IllegalArgumentException     * @throws SocketException     */    public CWTPInitiator(CWTPSocket wtp_Socket, IWTPUpperLayer upper_Layer,        CWTPEvent initPacket, boolean ackType, byte classType) {        init(wtp_Socket, upper_Layer, ackType, classType);        sendTID = CWTPInitiator.generateNewTID();        rcvTID = sendTID - 32768; // rcvTID = sendTID XOR 0x8000        // process the init service primitive        try {            process(initPacket);        } catch (EWTPAbortedException e) {            logger.warn("Event processing aborted", e);        }    }    private void init(CWTPSocket wtp_Socket, IWTPUpperLayer upper_Layer,        boolean ackType, byte classType) throws IllegalArgumentException {        this.upperLayer = upper_Layer;        this.wtpSocket = wtp_Socket;        uack = ackType;        setClassType(classType);        // initialize timer and add actionListener        // see declaration of a_timer above        a_timer = new javax.swing.Timer(a,                new ActionListener() {                    public void actionPerformed(ActionEvent e) {                        a_timer.stop();                        if (state == STATE_RESULT_RESP_WAIT) {                            // check acknowledgement counter                            if (!uack) { // if user acknowledgement is turned off                                // unfortunately I do not remember why I have coded this branch like this.                                logger.error("acknowledgement timer: exceeded " +                                    (aec + 1) + " time(s) --> cancel");                                CWTPAck send = new CWTPAck(sendTID);                                wtpSocket.send(send);                                w_timer.restart();                                setState(STATE_WAIT_TIMEOUT);                            } else if (aec < AEC_MAX) {                                if(logger.isDebugEnabled()) {                                    logger.debug("acknowledgement timer: exceeded " +                                        (aec + 1) + " time(s).");                                }                                aec++;                                a_timer.restart();                                setState(STATE_RESULT_RESP_WAIT);                            } else if (aec == AEC_MAX) {                                //abort if acknowledgement counter exceeds the maximum                                logger.error("acknowledgement timer: exceeded " +                                    (aec + 1) + " time(s) --> cancel");                                CWTPAbort send = new CWTPAbort(sendTID);                                send.setAbortReason(CWTPAbort.ABORT_REASON_NORESPONSE);                                wtpSocket.send(send);                                close(CWTPAbort.ABORT_REASON_NORESPONSE);                                aec = 0;                                setState(STATE_NULL);                            }                        }                    }                });        // see declaration of r_timer above        r_timer = new javax.swing.Timer(r,                new ActionListener() {                    public void actionPerformed(ActionEvent e) {                        r_timer.stop();                        if (state == STATE_RESULT_WAIT) {                            // check retransmission counter                            if (rcr < RCR_MAX) {                                /** @todo Ack(TIDok) already sent? Page 53 */                                if(logger.isDebugEnabled()) {                                    logger.debug("retransmission timer: exceeded " +                                    (rcr + 1) + " time(s) --> re-send");                                }                                rcr++;                                r_timer.restart();                                // re-send recent Invoke                                sentPDU.setRID(true);                                wtpSocket.send(sentPDU);                                setState(STATE_RESULT_WAIT);                            } else if (rcr == RCR_MAX) {                                logger.error("retransmission timer: exceeded " +                                    (rcr + 1) + " time(s) --> cancel");                                // abort                                close(CWTPAbort.ABORT_REASON_UNKNOWN);                                upperLayer.tr_abort(CWTPAbort.ABORT_REASON_UNKNOWN);                                rcr = 0;                                setState(STATE_NULL);                            }                        }                    }                });        // see declaration of w_timer above        w_timer = new javax.swing.Timer(w,                new ActionListener() {                    public void actionPerformed(ActionEvent e) {                        w_timer.stop();                        if (state == STATE_WAIT_TIMEOUT) {                            logger.debug("wait timeout");                            setState(STATE_NULL);                            close((short) 0x00);                        }                    }                });        // see declaration of w_timer above        s_timer = new javax.swing.Timer(s,                new ActionListener() {                    public void actionPerformed(ActionEvent e) {                        s_timer.stop();                        if (segment_sended > segment_sended_max) {                            if(logger.isDebugEnabled()) {                                logger.debug("wait_ack timeout (" + segment_sended +                                    "), abort.");                            }                            segment_sended = 1;                            setState(STATE_NULL);                            close((short) 0x00);                        } else {                            if (state == STATE_WAIT_ACK) {                                if(logger.isDebugEnabled()) {                                    logger.debug("wait_ack timeout (" +                                        segment_sended + "), re-sending segment.");                                }                                segment.setRID(true);                                wtpSocket.send(segment);                                segment_sended++;                                s_timer.restart();                            }                        }                    }                });    }    //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX    //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX    /**     * Invoked by the run()-Method of the Management-Entity CWTPManagement.     * Processes given protocol data units     * according to state machine described in section 9.5     * <b>Notice:</b> Only WTP Initiator is implemented!     *     * @param pdu the pdu to be processed in the state machine     */    public synchronized void process(CWTPPDU pdu) throws EWTPAbortedException {        if (aborted) {            throw new EWTPAbortedException(abortCode);        }        if (logger.isDebugEnabled()) {            logger.debug("process(CWTPPDU pdu)  " + sendTID + ": " + CWTPPDU.types[pdu.getPDUType()] +                " in " + states[state] + " class " + classType + " holdOn " +                holdOn);        }        switch (state) {        ///////////////////// NULL //////////////////////////////////////////////        case 0x00:            // because only initiator is implemented,            // we do not need to react on pdu-events in NULL state            break;        ///////////////////// RESULT WAIT ///////////////////////////////////////        case 0x01:            // RcvAck in RESULT WAIT            if (pdu.getPDUType() == CWTPPDU.PDU_TYPE_ACK) {                if (((CWTPAck) pdu).getTve_tok() &&                        ((classType == 1) || (classType == 2)) &&                        (rcr < RCR_MAX)) {                    CWTPAck send = new CWTPAck(((CWTPAck) pdu).getTID() &                            0x7fff);                    send.setTve_tok(true);                    wtpSocket.send(send);                    rcr++;                    r_timer.restart();                    setState(STATE_RESULT_WAIT);                } else if (((CWTPAck) pdu).getTve_tok() &&                        ((classType == 1) || (classType == 2))) {                    setState(STATE_RESULT_WAIT);                } else if ((classType == 2) && !holdOn) {                    r_timer.stop();                    upperLayer.tr_process(new CWTPEvent(pdu.getPayload(),                            CWTPEvent.TR_INVOKE_CNF));                    this.holdOn = true;                    setState(CWTPInitiator.STATE_RESULT_WAIT);                } else if ((classType == 2) && holdOn) {                    setState(STATE_RESULT_WAIT);                } else if (classType == 1) {                    r_timer.stop();                    upperLayer.tr_process(new CWTPEvent(pdu.getPayload(),                            CWTPEvent.TR_INVOKE_CNF));                    setState(STATE_NULL);                }            }            // RcvAbort in RESULT WAIT            else if (pdu.getPDUType() == CWTPPDU.PDU_TYPE_ABORT) {                short abortReason = ((CWTPAbort) pdu).getAbortReason();                close(abortReason);                upperLayer.tr_abort(abortReason);                setState(STATE_NULL);            }            // RcvResult in RESULT WAIT            else if (pdu.getPDUType() == CWTPPDU.PDU_TYPE_RESULT && classType == 2) {              CWTPResult res = (CWTPResult) pdu;              byte nextState=STATE_RESULT_RESP_WAIT;              // Stop timer              r_timer.stop();              // Check for segmentation indication              if( !res.getTTR() )              {                logger.debug("Not last packet");                segend = 0; seglast = 0;                segdata = new  ByteArrayOutputStream(64*1024); // 64kbyte segs                segTID = pdu.getTID();                try {

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线视频国内自拍亚洲视频| 国产欧美精品一区二区色综合 | 午夜激情久久久| 国产成人综合网| 91精品国产入口| 国产精品久久久久久久久免费樱桃| 一区二区三区国产精华| 国产suv精品一区二区三区| 欧美一级黄色录像| 亚洲视频一区在线| 国产精品一区在线| 日韩免费电影网站| 亚洲成人tv网| 色屁屁一区二区| 欧美国产精品专区| 国产美女一区二区三区| 在线电影国产精品| 亚洲精品免费在线| 99久久精品国产一区| 久久久久久99久久久精品网站| 亚洲成人动漫一区| 欧美图片一区二区三区| 亚洲婷婷综合久久一本伊一区| 国产经典欧美精品| 精品免费国产一区二区三区四区| 亚洲一区二区三区四区在线观看| av激情综合网| 国产精品久久久久永久免费观看| 国产精品性做久久久久久| 欧美xxxx老人做受| 极品销魂美女一区二区三区| 制服.丝袜.亚洲.中文.综合| 亚洲h动漫在线| 在线观看日韩电影| 亚洲综合精品自拍| 欧美性猛片aaaaaaa做受| 亚洲美女在线国产| 91亚洲午夜精品久久久久久| 国产精品传媒在线| 91麻豆国产福利在线观看| 国产精品国产三级国产| 国产制服丝袜一区| 国产日韩欧美高清| 亚洲一卡二卡三卡四卡| 99精品一区二区三区| 一区二区三区中文字幕| 欧美精品一区二区三区在线播放| 国产一区二区伦理| 亚洲最大的成人av| 欧美精品一区二区三区四区| 国产iv一区二区三区| 精品综合久久久久久8888| 国产亚洲欧美激情| 国产suv精品一区二区883| 国产精品系列在线| 91色在线porny| 亚洲国产日韩av| 91麻豆精品国产91久久久更新时间| 日本不卡123| 久久综合九色综合欧美亚洲| 大胆亚洲人体视频| 亚洲六月丁香色婷婷综合久久| 欧美三级日韩在线| 九九热在线视频观看这里只有精品| 久久综合久久99| 99视频国产精品| 亚洲与欧洲av电影| 制服丝袜中文字幕一区| 国产精品18久久久久| 国产精品国产自产拍高清av王其| 色偷偷久久一区二区三区| 午夜精品久久久久久久蜜桃app| 日韩视频免费直播| 粉嫩绯色av一区二区在线观看| 日韩理论片一区二区| 欧美日本在线看| 国产二区国产一区在线观看| 一区二区视频在线看| 制服.丝袜.亚洲.中文.综合| 国产成人在线色| 亚洲人123区| 欧美一区欧美二区| 高清不卡在线观看| 亚洲国产精品久久久久婷婷884 | 国产精一区二区三区| 亚洲视频一区二区免费在线观看| 欧美婷婷六月丁香综合色| 激情久久五月天| 亚洲人成在线观看一区二区| 91精品一区二区三区久久久久久 | 欧美一级爆毛片| 高清不卡在线观看av| 午夜精品在线视频一区| 国产高清无密码一区二区三区| 国产一二三精品| 欧美在线不卡视频| 精品久久久久久久久久久久久久久久久 | 中文字幕一区视频| 国产精品国产精品国产专区不片| 亚洲欧洲成人自拍| 亚洲国产成人精品视频| 风间由美性色一区二区三区| 久久99精品一区二区三区| 寂寞少妇一区二区三区| 亚洲人成影院在线观看| 欧美性xxxxx极品少妇| 国产一区二区三区观看| 亚洲高清久久久| 中文字幕欧美日本乱码一线二线| 欧美裸体一区二区三区| jlzzjlzz亚洲日本少妇| 另类小说视频一区二区| 一区二区三区精品在线| 精品久久人人做人人爱| 91福利国产精品| 成人午夜免费视频| 麻豆高清免费国产一区| 一级特黄大欧美久久久| 国产校园另类小说区| 欧美一区二区视频在线观看2020| 91片在线免费观看| 国产成人精品综合在线观看| 麻豆精品新av中文字幕| 亚洲久本草在线中文字幕| 中文字幕不卡一区| 欧美精品一区二区三区视频| 91精品久久久久久蜜臀| 色综合久久久久久久| 成人激情免费网站| 国产精品一二三| 极品尤物av久久免费看| 青青草91视频| 婷婷一区二区三区| 亚洲综合男人的天堂| 亚洲人精品午夜| 1024亚洲合集| 国产精品美女久久久久aⅴ| 久久综合九色综合欧美98| 一区二区三区日韩欧美| 久久久www成人免费毛片麻豆| 丝袜诱惑制服诱惑色一区在线观看| 国产精品久久久久7777按摩| 久久久精品综合| 欧美大片顶级少妇| 欧美成人乱码一区二区三区| 日韩无一区二区| 欧美丰满少妇xxxxx高潮对白| 欧美吞精做爰啪啪高潮| 欧美午夜宅男影院| 欧美色爱综合网| 欧美日韩卡一卡二| 欧美日韩夫妻久久| 成人一区二区三区视频在线观看| 国产亚洲污的网站| 91国偷自产一区二区三区成为亚洲经典 | 亚洲日本在线天堂| 精品一区二区三区久久| 欧美日韩国产经典色站一区二区三区 | 久久久久久久久99精品| 色综合久久99| 色综合中文字幕| 一本色道久久综合狠狠躁的推荐 | 亚洲国产精品人人做人人爽| 亚洲精品中文在线观看| 亚洲精品菠萝久久久久久久| 精品播放一区二区| 精品国产一区二区三区不卡 | 91麻豆精品国产91久久久久久久久| 国内成+人亚洲+欧美+综合在线| 国产日韩欧美精品综合| 国产在线视视频有精品| 中文字幕高清不卡| www.成人网.com| 日韩高清在线观看| 日韩一区中文字幕| 国产精品白丝av| 久久精品国产一区二区三区免费看 | 亚洲国产精品高清| 国产日本欧美一区二区| 中文字幕在线观看不卡| 中文字幕第一区第二区| 日韩欧美国产电影| 韩国v欧美v日本v亚洲v| 一区二区三区欧美久久| 国产精品久线观看视频| 日韩视频免费观看高清完整版 | 伊人一区二区三区| 亚洲国产电影在线观看| 日韩欧美一二区| 欧美日韩精品专区| 色菇凉天天综合网| 亚洲成av人片www| 色婷婷精品久久二区二区蜜臀av| 久久综合九色综合97婷婷女人 | 欧美日韩极品在线观看一区| 日韩欧美国产一区在线观看| 亚洲欧美国产高清| 国产不卡在线一区| 欧美videossexotv100| 国产欧美日韩视频在线观看|