⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cmpppacket.java

📁 移动短信网关接口源程序框架
💻 JAVA
字号:
// Decompiled by DJ v2.9.9.60 Copyright 2000 Atanas Neshkov  Date: 2004-4-16 11:12:23
// Home Page : http://members.fortunecity.com/neshkov/dj.html  - Check often for new version!
// Decompiler options: packimports(3) 
// Source File Name:   cmppPacket.java

package com.aspire.cmppApi;

import java.io.*;

// Referenced classes of package com.aspire.cmppApi:
//            cmppCommon, cmppSocket

public class cmppPacket
{

    public cmppPacket(cmppSocket cmppsocket)
    {
        TotalLength = 0;
        CommandID = 0;
        SequenceId = 0;
        conn = cmppsocket;
    }

    public int getCommandID()
    {
        return CommandID;
    }

    public byte[] getPacketBody()
    {
        return bodybytes;
    }

    public int getSequenceId()
    {
        return SequenceId;
    }

    public int getTotalLength()
    {
        return TotalLength;
    }

    public int readPacket()
    {
        int i = -6;
        try
        {
            int j = 0;
            headbytes = new byte[12];
            synchronized(conn)
            {
                int k;
                for(; j < 12; j += k)
                {
                    k = conn.din.read(headbytes, j, 12 - j);
                    if(k == -1)
                    {
                        byte byte0 = -6;
                        return byte0;
                    }
                }

                byte abyte2[] = new byte[4];
                cmppCommon.BytesCopy(headbytes, abyte2, 0, 3, 0);
                TotalLength = cmppCommon.Bytes4ToInt(abyte2);
                int l = TotalLength - 12;
                j = 0;
                bodybytes = new byte[l];
                int i1;
                for(; j < l; j += i1)
                {
                    i1 = conn.din.read(bodybytes, j, l - j);
                    if(i1 < 0)
                    {
                        byte byte1 = -6;
                        return byte1;
                    }
                }

            }
            byte abyte0[] = new byte[4];
            cmppCommon.BytesCopy(headbytes, abyte0, 4, 7, 0);
            CommandID = cmppCommon.Bytes4ToInt(abyte0);
            byte abyte1[] = new byte[4];
            cmppCommon.BytesCopy(headbytes, abyte1, 8, 11, 0);
            SequenceId = cmppCommon.Bytes4ToInt(abyte1);
            i = SequenceId;
        }
        catch(InterruptedIOException interruptedioexception)
        {
            i = -6;
            System.out.println("Read packet timeout...");
            System.out.println(interruptedioexception.toString());
            return -6;
        }
        catch(IOException ioexception)
        {
            i = -6;
            System.out.println("Read packet failed...");
            System.out.println(ioexception.toString());
            return i;
        }
        return i;
    }

    private int TotalLength;
    private int CommandID;
    private int SequenceId;
    private byte bodybytes[];
    private byte headbytes[];
    public cmppSocket conn;
    public static final int CMPP_Connect = 1;
    public static final int CMPP_Connect_REP = 0x80000001;
    public static final int CMPP_Terminate = 2;
    public static final int CMPP_Terminate_REP = 0x80000002;
    public static final int CMPP_Submit = 4;
    public static final int CMPP_Submit_REP = 0x80000004;
    public static final int CMPP_Deliver = 5;
    public static final int CMPP_Deliver_REP = 0x80000005;
    public static final int CMPP_Query = 6;
    public static final int CMPP_Query_REP = 0x80000006;
    public static final int CMPP_Cancel = 7;
    public static final int CMPP_Cancel_REP = 0x80000007;
    public static final int CMPP_Active_Test = 8;
    public static final int CMPP_Active_Test_REP = 0x80000008;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -