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

📄 counter.java

📁 亚信java实例 移动短信接口 cmpp3.0
💻 JAVA
字号:
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -