资源简介
cmpp2.0 移动短信 实现长连接 心跳检测 长短信发送功能

代码片段和文件信息
package com.qiji.chinamobile;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
import org.apache.log4j.Logger;
import com.qiji.chinamobile.domain.MsgHead;
/**
* 提交代码后的应答消息解析.
*
*/
public class MsgSubmitResp extends MsgHead {
private static Logger logger = Logger.getLogger(MsgSubmitResp.class);
private long msgId;
private int result;// 结果 0:正确 1:消息结构错 2:命令字错 3:消息序号重复 4:消息长度错 5:资费代码错
// 6:超过最大信息长 7:业务代码错 8:流量控制错 9:本网关不负责服务此计费号码 10:Src_Id错误
// 11:Msg_src错误 12:Fee_terminal_Id错误
// 13:Dest_terminal_Id错误
/**
* @param data
* byte[]
*/
public MsgSubmitResp(byte[] data) {
if (data.length == 21) {//8 + 8 + 4 17
ByteArrayInputStream bins = new ByteArrayInputStream(data);
DataInputStream dins = new DataInputStream(bins);
try {
// this.setTotalLength(data.length + 4);
this.setTotalLength(data.length);
int commandId = dins.readInt();
logger.info(“commandId:“ + commandId);
//this.setCommandId(dins.readInt());
int sequenceId = dins.readInt();
logger.info(“sequenceId:“ + sequenceId);
//this.setSequenceId(dins.readInt());
this.msgId = dins.readLong();
logger.info(“msgId:“ + msgId);
this.result = dins.readInt();
logger.info(“result:“ + result);
dins.close();
bins.close();
logger.info(“msgId:“ + msgId);
} catch (IOException e) {
e.printStackTrace();
}
} else {
logger.info(“发送短信IMSP回复解析数据包出错,包长度不一致。长度为:“ + data.length);
}
}
/**
* @功能 读取流
* @param inStream
* @return 字节数组
* @throws Exception
*/
public static byte[] readStream(InputStream inStream) throws Exception {
ByteArrayOutputStream outSteam = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
int len = -1;
while ((len = inStream.read(buffer)) != -1) {
outSteam.write(buffer 0 len);
}
outSteam.close();
inStream.close();
return outSteam.toByteArray();
}
public long getMsgId() {
return msgId;
}
public void setMsgId(long msgId) {
this.msgId = msgId;
}
public int getResult() {
return result;
}
public void setResult(int result) {
this.result = result;
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1317 2016-12-19 13:38 chinamobile\domain\MsgActiveTestResp.java
文件 1008 2016-12-16 14:37 chinamobile\domain\MsgCommand.java
文件 3372 2016-12-16 14:38 chinamobile\domain\MsgConnect.java
文件 3631 2016-12-19 14:27 chinamobile\domain\MsgConnectResp.java
文件 6909 2016-12-16 14:41 chinamobile\domain\MsgDeliver.java
文件 1393 2016-12-16 14:42 chinamobile\domain\MsgDeliverResp.java
文件 2431 2016-12-16 14:42 chinamobile\domain\MsgHead.java
文件 8055 2016-12-16 14:42 chinamobile\domain\MsgSubmit.java
文件 2684 2016-12-19 11:23 chinamobile\MsgSubmitResp.java
文件 7094 2016-12-21 11:53 chinamobile\util\CmppSender.java
文件 1008 2016-12-22 15:30 chinamobile\util\MsgActivityTimer.java
文件 1628 2016-12-16 14:43 chinamobile\util\MsgConfig.java
文件 22047 2016-12-23 10:00 chinamobile\util\MsgContainer.java
文件 5806 2016-12-22 15:30 chinamobile\util\MsgUtils.java
目录 0 2016-12-23 10:01 chinamobile\domain
目录 0 2016-12-23 10:01 chinamobile\util
目录 0 2016-12-23 10:01 chinamobile
----------- --------- ---------- ----- ----
68383 17
相关资源
- Rancher 2.0 架构设计
- Borland Socket Server Fix2.0 D7
- Microsoft Forms 2.0107770
- 西门坡论坛pb框架 普通版 2.0 非常漂
- 联想扬天电脑用户手册
-
分别适用于.NET fr
amework 2.0和4.0的E - 报文模拟仿真测试工具2.0
- OPC插件OPC Core Components 2.00 SDK 2.20
- 基于J2EE物资出入库管理系统
- txt测井曲线转换las2.0(新编)
- 收藏奉献_DOS汉字系统03:WPS 2.0 + 金山
- 详细图解联想Y430\\Y530笔记本SLIC表2.
- SentinelRMSToolkitv2.0.rar
- powerpaste-4.0.1-317(兼容最新tinymce5.2.
- xlrd-1.2.0完整包
- USB网卡驱动 USB2.0 TO Fast Ethernet Adapte
- st foc 2.0 中文手册
- PRS+ 2.0.17 中文版 for SONY PRS 300
- 华硕P8H61/USB3 R2.0主板BIOS驱动 免费版
- asus华硕 m5a97 le r2.0主板bios 官方版
- hostapd-2.0.tar.gz
- CMPP3.0模拟网关,绝对好用,自己测试
- USB PCB布局布线要点及注意事项
- 美松打印机SDK MsPrintSDK-Demo-DLL-CShare-
- Spring-Data-Redis2.0+Spring5
- Visual Assist X 通用破解补丁v2.0 适用于
- USB Power Delivery 2.0与3.0区别
- 钰硕ar8151网卡驱动 win7 64位 win7/10/xp
- 华为公司人力资源管理纲要2.0总纲公
- BPMN2.0 Modeler for Visio
评论
共有 条评论