counter.java
来自「亚信java实例 移动短信接口 cmpp3.0」· Java 代码 · 共 51 行
JAVA
51 行
package sample;/** * @File: Counter.java * @Description: Thread Test for CMPP2.0, successful or failed counts * @Copyright: Copyright 2002 By AsiaInfo(c) ISMG. All right reserved * @Date: 2002-10-24 * @Version 1.0 *//** * action counter */public class Counter{ public static int ciSendSuccess=0; public static int ciSendFail=0; public static int ciRecvSuccess=0; public static int ciRecvFail=0; /** * MT sent counts, synchronized method */ public synchronized static void SendAdd(int aiErrorCode) { //this following code can not be compiled in java, but works well in c/c++ //(aiErrorCode == 0)? ciSendSuccess++ : ciSendFail++ ; if ( aiErrorCode == 0 ) { ciSendSuccess ++ ; } else { ciSendFail ++ ; } } //end SendAdd ( int ) /** * MO received counts, synchronized method */ public synchronized static void RecvAdd(int aiErrorCode) { //(aiErrorCode == 0)? ciRecvSuccess++ : ciRecvFail++ ; if ( aiErrorCode == 0 ) { ciRecvSuccess ++ ; } else { ciRecvFail ++ ; } } //end RecvAdd ( int )}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?