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

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

?? wapptr.java~346~

?? jwap 協議 udp 可以用于手機通訊
?? JAVA~346~
?? 第 1 頁 / 共 5 頁
字號:
            response = (Response) waitForCompletion(mgr, timeout);
            if (response == null) {
                if (count < 2) {
                    if (request instanceof GetRequest) {
                        System.out.println(count +
                                           " Executing GET Request for URL " +
                                           request.getURL());
                        if (log.isDebugEnabled()) {
                            log.debug("Executing GET Request for URL " +
                                      request.getURL());
                        }
                        mgr = session.s_get(headers, request.getURL());
                    } else if (request instanceof PostRequest) {
                        System.out.println(count +
                                           " Executing POST Request for URL " +
                                           request.getURL());
                        if (log.isDebugEnabled()) {
                            log.debug("Executing POST Request for URL " +
                                      request.getURL());
                        }
                        PostRequest post = (PostRequest) request;
                        mgr = session.s_post(post.getWSPHeaders(),
                                             post.getRequestBody(),
                                             post.getContentType(), post.getURL());
                    }

                }
            } else {
                break;
            }
        }
        if (response == null) {
            throw new SocketException("Timeout executing request");
        }
        return response;
    }

    /**
     * Connect to the WAP gateway. Before requests can be executed, this method
     * must be called.
     * @throws SocketException if the connection could not be established
     * @throws IllegalStateException if the client is already connected
     */
    public synchronized void connect() throws SocketException,
            IllegalStateException {
        connect(DEFAULT_CONNECT_TIMEOUT);
    }

    /**
     * Connect to the WAP gateway. Before requests can be executed, this method
     * must be called.
     * @param timeout timeout in milliseconds
     * @throws SocketException if the connection could not be established
     * @throws IllegalStateException if the client is already connected
     */
    public synchronized int connect_http(long timeout) throws SocketException,
            IllegalStateException {
        int ret = 7;
        if (http_session != null) {
            throw new IllegalStateException("Already connected");
        }
        gwPort = 80;
        disconnectTimeout = timeout;
        pendingRequests.clear();
        System.out.println("開始連接網關 " + gwAddr.getHostAddress() + ":" + gwPort);
        if (log.isDebugEnabled()) {
            log.debug("Establishing WSP session with " + gwAddr.getHostAddress() +
                      ":" + gwPort);
        }
        http_session = null;
        http_session = new HttpSession(gwAddr, gwPort, localAddr, localPort,
                                       upperLayerImpl, false);

        /* if(httpwaitForCompletion(timeout)==1)
         {
             System.exit(1);
         }*/
        ret = http_session.Sconnect(gwAddr, gwPort);
        if (ret == 5) {
            ret = 5;
            System.out.println("連接網關成功 ");
            log.debug("Connection established");
        } else {
            System.out.println("連接網關失敗 ");
        }

        return ret;
    }

    /**
     * Connect to the WAP gateway. Before requests can be executed, this method
     * must be called.
     * @param timeout timeout in milliseconds
     * @throws SocketException if the connection could not be established
     * @throws IllegalStateException if the client is already connected
     */
    public synchronized int connect(long timeout) throws SocketException,
            IllegalStateException {
        int ret = 0;
        ret = connect(null, timeout);
        return ret;
    }

    /**
     * Connect to the WAP gateway. Before requests can be executed, this method
     * must be called.
     * @param timeout timeout in milliseconds
     * @param headers WSP headers used for connect or null
     *   objects. The headers will be encoded using the default WAP codepage.
     * @throws SocketException if the connection could not be established
     * @throws IllegalStateException if the client is already connected
     */
    public synchronized int connect(CWSPHeaders headers, long timeout) throws
            SocketException, IllegalStateException {

        int ret = 8;
        if (session != null) {
            throw new IllegalStateException("Already connected");
        }

        disconnectTimeout = timeout;
        pendingRequests.clear();
        System.out.println("開始連接網關 " + gwAddr.getHostAddress() + ":" + gwPort);
        if (log.isDebugEnabled()) {
            log.debug("Establishing WSP session with " + gwAddr.getHostAddress() +
                      ":" + gwPort);
        }

        session = new CWSPSession(gwAddr, gwPort, localAddr, localPort,
                                  upperLayerImpl, false);

        session.linkgate = linkgate;
        session.s_connect(headers, AgentName);

        if (linkgate == 1) {
            Object result = waitForCompletion(sessionLock, timeout);

            if (result == null) {
                CWSPSession ts = session;
                session = null;
                ret = 7;
                try {
                    ts.s_disconnect();
                } catch (Exception unknown) {}
                throw new SocketException("connect: Timeout occurred");
            }

            if (result != null) {

                if (result instanceof CWSPSocketAddress[]) {
                    // redirect received ...
                    CWSPSocketAddress[] addr = (CWSPSocketAddress[]) result;
                    if (addr.length > 0) {
                        // Take the first address and try to reconnect...
                        gwAddr = addr[0].getAddress();
                        int p = addr[0].getPort();
                        if (p > 0) {
                            gwPort = p;
                        }
                        session = null;
                        System.out.println("重定向網關 " + gwAddr.getHostAddress() +
                                           ":" +
                                           gwPort);
                        if (log.isDebugEnabled()) {
                            log.debug("Redirect to " + gwAddr.getHostAddress() +
                                      ":" + gwPort);
                        }
                        ret = connect(headers, timeout);
                        return ret;
                    }

                } else if (!CONNECTED.equals(result)) {
                    ret = 7;
                    CWSPSession ts = session;
                    session = null;
                    ts.s_disconnect();
                    if (result == null) {
                        throw new SocketException(
                                "Timeout while establishing connection");
                    } else if (!CONNECTED.equals(result)) {
                        throw new SocketException("Connection failed.");
                    }
                }
            }
            if (CONNECTED.equals(result)) {
                ret = 5;
                System.out.println("連接網關成功 ");
                log.debug("Connection established");
            } else {
                System.out.println("連接網關失敗 ");
            }
        } else {
            ret = 5;
        }
        return ret;
    }

    /**
     * Disconnect from the WAP gateway. This releases used resources as well.
     */
    public synchronized void disconnect() {
        if (session == null) {
            return;
        }
        log.debug("Disconnecting client...");
        CWSPSession ts = session;
        session = null;
        ts.s_disconnect();
        // Wait for confirmation
        Object result = waitForCompletion(sessionLock, disconnectTimeout);
        session = null;
        log.debug("Client disconnected...");
    }

    public synchronized void http_disconnect() {
        if (http_session == null) {
            return;
        }
        log.debug("Disconnecting client...");
        //CWSPSession ts = session;
        //session = null;
        //ts.s_disconnect();
        // Wait for confirmation
        http_session.pThreadClose();
        http_session = null;
        log.debug("Client disconnected...");
    }


    /**
     * Check if the client is currently connected to the WAP gateway
     * @return true if the client is connected, false otherwise
     */
    public synchronized boolean isConnected() {
        return session != null;
    }

    private static byte[] readPostData(String input) throws IOException {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        InputStream in = null;
        if (input == null) {
            System.out.println(
                    "Reading post-data from input stream, hit EOF when done");
            in = System.in;
        } else if ("-".equals(input)) {
            in = System.in;
        } else {
            in = new FileInputStream(input);
        }
        byte[] buf = new byte[1024];
        int read = 0;
        while ((read = in.read(buf)) > 0) {
            out.write(buf, 0, read);
        }
        in.close();
        return out.toByteArray();
    }


    private int httpwaitForCompletion(long timeout) {
        int ret = 0;
        long startAt = 0;
        int first = 0;
        if (timeout > 0) {
            startAt = System.currentTimeMillis();
        } while (http_session != null) {
            if (waitfor == 1) {
                ret = 0;
                break;
            }
            if (waitfor == 2) {
                ret = 1;
                waitfor = 0;
                break;
            }

            try {
                Thread.sleep(1000);
            } catch (InterruptedException ex) {
            }
            if (first == 1) {
                startAt = markflg.Getbagflg();
            }
            first = 1;
            if (timeout > 0 && (startAt + timeout) < System.currentTimeMillis()) {
                log.debug("Timeout occurred");
                System.out.println("Timeout occurred");
                ret = 1;
                break;
            }
        }
        //ret=1;
        return ret;
    }

    private Object waitForCompletion(Object key, long timeout) {
        Object object = null;
        long startAt = 0;
        long ntimeout = timeout;
        int first = 0;
        if (timeout > 0) {
            startAt = System.currentTimeMillis();
        } while (object == null) {

            if (first == 1) {
                startAt = markflg.Getbagflg();
            }
            first = 1;
            if (markflg.writefileflg() == 1) {
                ntimeout = markflg.FileWrite();
                //log.error("f:" + ntimeout);
            }
            //log.error("f:" + startAt);
            if (timeout > 0 && (startAt + ntimeout) < System.currentTimeMillis()) {
                log.debug("Timeout occurred");
                break;
            }
            synchronized (pendingRequests) {
                object = pendingRequests.remove(key);
                if (object == null) {
                    try {
                        pendingRequests.wait(ntimeout);
                    } catch (InterruptedException e) {
                        log.warn("Interrupted");
                    }
                }
            }
        }
        return object;
    }

    private void complete(Object key, Object value) {
        synchronized (pendingRequests) {
            pendingRequests.put(key, value);
            pendingRequests.notifyAll();
        }
    }

    private void writeBytesToFile(byte[] payload) {

        markflg.wflg = 1;
        String dstr, wbfile, wmlfile, htmlfile;
        wbfile = wmlfile = htmlfile = "";
        int flag20 = 0;
        int kjava = 0;
        System.out.println("writing to a file");
        Calendar ca = Calendar.getInstance();
        Date dt = new Date();
        ca.setTime(dt);
        dstr = new String(String.valueOf(ca.get(Calendar.YEAR)));
        dstr = dstr + ca.get(Calendar.MONTH) + ca.get(Calendar.DAY_OF_MONTH) +
               ca.get(Calendar.HOUR) + ca.get(Calendar.MINUTE) +
               ca.get(Calendar.SECOND);
        String currentdir = System.getProperty("user.dir");

        int wmlflag = 0;
        if (FileType.equals("wml") || FileType.equals("") ||
            FileType.equals("null")) {
            wmlflag = 1;
            if (xhtml_wml == 1) {
                LogStr[11] = "df" + dstr + ".wbxml";
            } else {
                LogStr[11] = "df" + dstr + ".wml";

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久欧美一区二区| 欧美一级国产精品| 精品国内二区三区| 一区二区三区在线观看欧美| 日韩福利电影在线观看| 91视频.com| 中文字幕av一区二区三区高| 另类小说图片综合网| 欧美日韩一区二区欧美激情| 亚洲欧洲精品一区二区三区不卡| 国产一区二区在线免费观看| 欧美日韩情趣电影| 亚洲日本在线观看| 不卡影院免费观看| 国产午夜精品美女毛片视频| 日韩电影免费在线看| 欧美丰满少妇xxxxx高潮对白 | 丝袜美腿亚洲一区二区图片| 99久久免费精品高清特色大片| 日韩欧美国产三级| 视频精品一区二区| 欧美日韩精品一区二区三区四区| 亚洲四区在线观看| 成人网页在线观看| 国产日产亚洲精品系列| 麻豆成人免费电影| 欧美一级爆毛片| 天堂va蜜桃一区二区三区漫画版| 欧美午夜理伦三级在线观看| 亚洲免费看黄网站| 色综合久久久久综合体| 日韩毛片视频在线看| 91视频在线观看| 国产精品久久久99| av不卡在线观看| 中文字幕日韩精品一区| 波多野结衣亚洲一区| 欧美激情一区三区| www.日韩精品| 中文字幕制服丝袜成人av | 日韩综合小视频| 欧美乱妇一区二区三区不卡视频| 亚洲风情在线资源站| 欧美日韩免费视频| 奇米精品一区二区三区在线观看一 | 日韩写真欧美这视频| 日韩黄色免费电影| 在线综合亚洲欧美在线视频| 午夜精品视频在线观看| 欧美一区二区三区思思人| 七七婷婷婷婷精品国产| 欧美zozo另类异族| 国产精品自拍av| 国产精品嫩草久久久久| www.av精品| 一区二区三区欧美日韩| 欧美久久久久免费| 精品亚洲国内自在自线福利| 久久先锋影音av| 白白色 亚洲乱淫| 亚洲一区二区三区小说| 欧美肥妇毛茸茸| 国产一区二区伦理| 中文字幕一区二区三区在线观看 | 美日韩一区二区三区| 久久众筹精品私拍模特| 欧美欧美午夜aⅴ在线观看| 美日韩一区二区| 国产丝袜欧美中文另类| 99久久99久久久精品齐齐| 亚洲国产综合91精品麻豆| 7777精品伊人久久久大香线蕉| 精品亚洲porn| 91精品国产乱| 国产精品欧美一区喷水| 91麻豆精品在线观看| 婷婷成人激情在线网| 欧美精品一区二区三区一线天视频| 国产一级精品在线| 亚洲视频1区2区| 91精品啪在线观看国产60岁| 国产黄色精品网站| 亚洲综合网站在线观看| 日韩欧美的一区二区| 成人午夜视频网站| 亚洲福中文字幕伊人影院| 精品国产一区二区国模嫣然| 91免费观看在线| 秋霞电影网一区二区| 国产精品初高中害羞小美女文| 欧美日韩在线免费视频| 久久99九九99精品| 亚洲美女免费视频| 欧美精三区欧美精三区| 成人午夜精品一区二区三区| 亚洲午夜视频在线观看| 国产视频亚洲色图| 欧美日韩三级在线| 国产成人av影院| 国产精品少妇自拍| 欧美精品久久久久久久多人混战| 国产一区二区三区黄视频 | 国产精品国模大尺度视频| 国产嫩草影院久久久久| 在线亚洲人成电影网站色www| 美女精品自拍一二三四| 亚洲欧美日韩国产综合在线| 精品国产123| 欧美欧美午夜aⅴ在线观看| 成人污污视频在线观看| 老司机精品视频一区二区三区| 亚洲欧美精品午睡沙发| 国产日韩三级在线| 在线成人av网站| 色综合久久久久久久| 国产九色sp调教91| 日韩高清电影一区| 亚洲自拍偷拍网站| 国产精品成人一区二区三区夜夜夜| 欧美va在线播放| 精品视频一区二区不卡| 91亚洲国产成人精品一区二三| 久草精品在线观看| 图片区日韩欧美亚洲| 亚洲欧美偷拍三级| 国产日本欧美一区二区| 欧美不卡一区二区三区四区| 欧美日韩激情一区二区| 91麻豆精东视频| 成人午夜私人影院| 国内欧美视频一区二区| 日本三级韩国三级欧美三级| 一区二区三区四区不卡在线| 亚洲国产精品99久久久久久久久| 精品久久久久久无| 欧美一区二区精品| 视频一区在线视频| 综合亚洲深深色噜噜狠狠网站| 夜夜爽夜夜爽精品视频| 国产女人水真多18毛片18精品视频| 日韩一级黄色片| 6080日韩午夜伦伦午夜伦| 欧美日韩电影一区| 欧日韩精品视频| 在线免费观看日本一区| 91在线精品一区二区| av一区二区久久| 不卡的av中国片| av在线播放成人| 成人性生交大片免费| 国产v综合v亚洲欧| 国产99久久久国产精品| 国产ts人妖一区二区| 成人在线综合网| 成av人片一区二区| 99视频在线观看一区三区| 99riav一区二区三区| av电影在线不卡| 色综合久久综合网97色综合| 色偷偷成人一区二区三区91| 色综合中文字幕国产 | 久久国产视频网| 美美哒免费高清在线观看视频一区二区| 人人超碰91尤物精品国产| 久久精品二区亚洲w码| 久久99国内精品| 丰满亚洲少妇av| 97久久人人超碰| 日本高清不卡视频| 欧美丰满少妇xxxxx高潮对白| 日韩一区国产二区欧美三区| 日韩专区一卡二卡| 精品国产乱码久久久久久久| 精品国产第一区二区三区观看体验| 欧美不卡一区二区三区| 久久久久99精品一区| 国产精品蜜臀在线观看| 亚洲麻豆国产自偷在线| 午夜av一区二区三区| 毛片av一区二区| 成人性生交大片免费看中文网站| 成人免费高清在线观看| 91尤物视频在线观看| 国产1区2区3区精品美女| 成人午夜激情视频| 欧美亚洲高清一区二区三区不卡| 欧美日韩国产综合一区二区 | 亚洲成人自拍偷拍| 亚洲精品国久久99热| 亚洲超碰97人人做人人爱| 午夜视黄欧洲亚洲| 免费成人在线视频观看| 成人丝袜18视频在线观看| 成人av资源下载| 日本高清不卡视频| 337p亚洲精品色噜噜狠狠| 欧美经典一区二区| 一区二区三区四区在线播放| 视频在线观看一区二区三区| 国产宾馆实践打屁股91|