📄 comconstants.java
字号:
package com.wayout.wayoutsp.communication;import java.util.*;import java.io.*;import com.wayout.wayoutsp.publics.PublicConstants;/** * <p>Title: 公司运营项目</p> * <p>Description: 实现短信SP之功能.短信互动系统</p> * <p>Copyright: Copyright (c) 2002</p> * <p>Company: wayout</p> * @author wayout Software * @version 1.01 */public class ComConstants { /** * 关于Cmpp实体参数的变量 * * Description: 以下几个变量的意义依次是: <br> * 1 MBCAParaId wayoutsp(全国通讯代理) 的参数标示 <br> * 4 o_wayoutspInfo wayoutsp 参数 <br> * 12 MpcuId MPCU编号 <br> * 14 wayoutspSendConNum 与wayoutsp建立的只发连接数目 <br> * 15 wayoutspRecvConNum 与wayoutsp建立的只收连接数目 <br> * 16 mpcRouteTab 路由信息HASH表 <br> * 17 mpcRouteTabSize 路由信息HASH表大小 <br> * 18 MPCUlastversion MPCU最高支持的版本 <br> */ public static IsmgInfo o_IsmgInfo = new IsmgInfo(); public static int IsmgSendConNum = 1; public static int IsmgRecvConNum = 1; public static Hashtable mpcRouteTab; public static int mpcRouteTabSize =10; public static byte wayoutsplastversion = 12; /** * 关于参数变更的变量 * * Description: 以下几个变量的意义依次是: <br> * 3 nwayoutsp_Modi_Flag wayoutsp参数改动标志 <br> */ public static int nIsmg_Modi_Flag = 0; /** * 关于状态检查的常量 * * Description: 以下几个常量的意义依次是: <br> * 1 VALID 激活状态 <br> * 2 INVALID 未激活状态 <br> */ static final int VALID = 0; static final int INVALID = 1; /** * 关于Socket状态的常量 * * Description: 以下几个常量的意义依次是: <br> * 1 SUCCEED 正常 <br> * 2 ERROR_SOCKET 套接字错误 <br> * 3 ERROR_INTERRUPT 中断错误 <br> * 4 ERROR_DATA 数据错误 <br> * 5 ERROR_OTHER 其他未知错误 <br> * 6 STOP_THREAD 停止线程 <br> */ static final int SUCCEED = 0; static final int ERROR_SOCKET = -1; static final int ERROR_INTERRUPT = -2; static final int ERROR_DATA = -3; static final int ERROR_OTHER = -4; static final int STOP_THREAD = -5; /** * 关于连接状态的常量 * * Description: 以下几个常量的意义依次是: <br> * 1 WORKING 正常 <br> * 2 NOTCONNECTED 未连接 <br> * 3 NOTLOGIN 未登录 <br> * 4 NOTACTIVE 未被激活 <br> */ static final String WORKING = "working"; static final String NOTCONNECTED = "not connected"; static final String NOTLOGIN = "not login"; static final String NOTACTIVE = "not active"; /** * 关于登录类型的常量 * * Description: 以下几个常量的意义依次是: <br> * 1 RECV_ONLY 只发型 <br> * 2 SEND_ONLY 只收型 <br> * 3 RECV_SEND 收发型 <br> */ static final byte RECV_ONLY = 2;// bindtype = 1 (recv type) static final byte SEND_ONLY = 1;// bindtype = 0 (send type) //static final byte RECV_SEND = 2;// bindtype = 2 /** * 关于系统运行状态的常量 * * Description: 以下几个常量的意义依次是: <br> * 1 RUNNING 正常运行 <br> * 2 NORUNNING 没有运行 <br> * 3 ACTIVE 激活 <br> * 4 NOACTIVE 未激活 <br> * 5 STOP 停止 <br> * 6 NOSTOP 未停止 <br> */ public static final int RUNNING = 1; public static final int NORUNNING = -1; public static final int ACTIVE = 1; public static final int NOACTIVE = -1; public static final int STOP = 1; public static final int NOSTOP = 0; /** *for save pack info *关于消息包保存的参数 */ public static int CmppSAVEDATA_SLEEPTIME= 300; public static int CmppCOMMITDATA_INTSEC = 3000; //(ms) /** *for reSend pack *关于消息包重发的参数 */ public static int CmppRESEND_SLEEPTIME= 10000;//重发线程休眠时间(ms) public static int CmppRESEND_INTERVAL= 60; //重发时间间隔(秒) public static int CmppRESEND_COUNT= 5; //最多重发次数(次) public static int CmppRESEND_LIVETIME= 400; //消息在内存中的最长生命周期(秒) /** *for maintance thread *关于主线程启动的参数 */ public static int CmppMAINTANCE_SLEEPTIME= 15000; /** *for smsc report *关于状态报告的参数 */ /** *for set sock propertiy *关于套接字属性的参数 */ public static int CmppRCVSOCK_TIMEOUT= 30000; public static final int Cmpp_MAX_MSG_LEN= 800; public static final int Cmpp_MIN_MSG_LEN= 12; public static final int Cmpp_MAX_NOTACTIVE_SECOND= 150; /** *for set the savedata buffer size *关于保存数据的缓冲区大小的参数 */ public static int CmppVECTOR_NUM= 5000; public static int CmppVECTOR_MAXSIZE= 15000; /** * the only id for the msg * 短消息序列号变量 (在一定时间内保证唯一性) */ public static int msgSeqNo = 0 ; public static int ShortLen =50; public static int mt_number,mo_number,fmo_number, msgid_number; public static int test_number=0; public synchronized static int getSeqNo(){ int temp_SeqNo=ComConstants.fmo_number++; if (ComConstants.fmo_number>=2140000000) ComConstants.fmo_number=1; return temp_SeqNo; } /** * 公有方法,线程休眠(单位:微秒) * @param miniSec */ public static void threadSleep(int miniSec) { try { Thread.sleep(miniSec); } catch(InterruptedException e) { com.wayout.wayoutsp.publics.PublicConstants.writeLog.info("sleep interrupt .",0); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -