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

📄 cmppterminate.java

📁 短信平台CMPP30 的JAVA程序,(含SQL数据库)
💻 JAVA
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   CMPPTerminate.java

package com.cmpp3_0.process;

import com.cmpp3_0.body.Header;
import com.cmpp3_0.util.CMPPUtil;
import com.cmpp3_0.util.Logger;
import java.io.*;
import java.net.SocketException;

// Referenced classes of package com.cmpp3_0.process:
//            CMPPSocket, CMPPAPIs

public class CMPPTerminate
{

    private byte headBytes[];
    private Header headContent;
    private CMPPSocket socket;

    public CMPPTerminate(CMPPSocket socket)
    {
        headContent = new Header(12, 2, 0);
        headBytes = new byte[12];
        this.socket = socket;
        CMPPUtil.bytesCopy(CMPPUtil.intToFourBytes(headContent.getTotalLength()), headBytes, 0, 4, 0);
        CMPPUtil.bytesCopy(CMPPUtil.intToFourBytes(headContent.getCommandId()), headBytes, 0, 4, 4);
        CMPPUtil.bytesCopy(CMPPUtil.intToFourBytes(headContent.getSeqId()), headBytes, 0, 4, 8);
    }

    public int getSequenceId()
    {
        return headContent.getSeqId();
    }

    public int getTotalLength()
    {
        return headContent.getTotalLength();
    }

    public int sendTerminate()
    {
        int result = 0;
        socket.out.write(headBytes);
        socket.out.flush();
        break MISSING_BLOCK_LABEL_80;
        SocketException se;
        se;
        Logger.writeLog(-2, "TERMINATE FAILURE:SOCKET Exception!--可能是TCP/IP连接出现错误!-- 发送断开链路包失败!", "cmpp");
        result = -505;
        return result;
        IOException ie;
        ie;
        Logger.writeLog(-2, "TERMINATE FAILURE:IOException! -- 发送断开链路包失败!", "cmpp");
        result = -103;
        return result;
        Exception ie;
        ie;
        Logger.writeLog(-2, "TERMINATE FAILURE:Exception! -- 发送断开链路包失败!", "cmpp");
        result = -104;
        return result;
        if(CMPPAPIs.isDebugMode())
            System.out.println("发送了TERMINATE包!");
        return result;
    }

    public void setSequenceId(int seqId)
    {
        headContent.setSeqId(seqId);
        CMPPUtil.bytesCopy(CMPPUtil.intToFourBytes(seqId), headBytes, 0, 4, 8);
    }
}

⌨️ 快捷键说明

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