com.hoten.cmpp源码
需积分: 0 16 浏览量
更新于2018-09-14
收藏 364KB ZIP 举报
com.hoten.cmpp源码,用于cmpp2连接,发送短信,代码注释齐全
用法
cmpp = new CMPP_Shell("xxx");
if (!cmpp.initCMPP("xxx.properties")) {
this.logger.error("初始化cmpp失败!");
}
SubmitMsg cs = new SubmitMsg();
setSubmitMsg(cs);
cs.sDestTerminalId = phone;
cs.sMsgContent = content;
cs.nMsgLength = content.length();
cs.sSrcId = srcId;
int stat;
try {
stat = cmpp.submit(cs);
if (stat == 0) {
logger.debug("短信发送成功");
return 0;
}else {
logger.error("短信 {} 发送失败,stat= {}", phone, stat);
return 1;
}
} catch (Exception ex) {
ex.printStackTrace();
}