亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? smpptest.java

?? Short Message Peer to Peer
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
/*
 * Copyright (c) 1996-2001
 * Logica Mobile Networks Limited
 * All rights reserved.
 *
 * This software is distributed under Logica Open Source License Version 1.0
 * ("Licence Agreement"). You shall use it and distribute only in accordance
 * with the terms of the License Agreement.
 *
 */
package org.smpp.test;

import java.io.*;
import java.util.Properties;

import org.smpp.*;
import org.smpp.TCPIPConnection;
import org.smpp.pdu.*;
import org.smpp.debug.Debug;
import org.smpp.debug.Event;
import org.smpp.debug.FileDebug;
import org.smpp.debug.FileEvent;
import org.smpp.util.Queue;

/**
 * Class <code>SMPPTest</code> shows how to use the SMPP toolkit.
 * You can bound and unbind from the SMSC, you can send every possible 
 * pdu and wait for a pdu sent from the SMSC.
 *
 * @author Logica Mobile Networks SMPP Open Source Team
 * @version $Revision: 1.2 $
 */
public class SMPPTest {
	static final String copyright =
		"Copyright (c) 1996-2001 Logica Mobile Networks Limited\n"
			+ "This product includes software developed by Logica by whom copyright\n"
			+ "and know-how are retained, all rights reserved.\n";
	static final String version = "SMPP Open Source test & demonstration application, version 1.1\n";

	static {
		System.out.println(copyright);
		System.out.println(version);
	}

	/**
	 * Directory for creating of debug and event files.
	 */
	static final String dbgDir = "./";

	/**
	 * The debug object.
	 * @see FileDebug
	 */
	static Debug debug = new FileDebug(dbgDir, "test.dbg");

	/**
	 * The event object.
	 * @see FileEvent
	 */
	static Event event = new FileEvent(dbgDir, "test.evt");

	/**
	 * File with default settings for the application.
	 */
	static String propsFilePath = "./etc/smpptest.cfg";

	static BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in));

	/**
	 * This is the SMPP session used for communication with SMSC.
	 */
	static Session session = null;

	/**
	 * Contains the parameters and default values for this test
	 * application such as system id, password, default npi and ton
	 * of sender etc.
	 */
	Properties properties = new Properties();

	/**
	 * If the application is bound to the SMSC.
	 */
	boolean bound = false;

	/**
	 * If the application has to keep reading commands
	 * from the keyboard and to do what's requested.
	 */
	private boolean keepRunning = true;

	/**
	 * Address of the SMSC.
	 */
	String ipAddress = null;

	/**
	 * The port number to bind to on the SMSC server.
	 */
	int port = 0;

	/**
	 * The name which identifies you to SMSC.
	 */
	String systemId = null;

	/**
	 * The password for authentication to SMSC.
	 */
	String password = null;

	/**
	 * How you want to bind to the SMSC: transmitter (t), receiver (r) or
	 * transciever (tr). Transciever can both send messages and receive
	 * messages. Note, that if you bind as receiver you can still receive
	 * responses to you requests (submissions).
	 */
	String bindOption = "t";

	/**
	 * Indicates that the Session has to be asynchronous.
	 * Asynchronous Session means that when submitting a Request to the SMSC
	 * the Session does not wait for a response. Instead the Session is provided
	 * with an instance of implementation of ServerPDUListener from the smpp
	 * library which receives all PDUs received from the SMSC. It's
	 * application responsibility to match the received Response with sended Requests.
	 */
	boolean asynchronous = false;

	/**
	 * This is an instance of listener which obtains all PDUs received from the SMSC.
	 * Application doesn't have explicitly call Session's receive() function,
	 * all PDUs are passed to this application callback object.
	 * See documentation in Session, Receiver and ServerPDUEventListener classes
	 * form the SMPP library.
	 */
	SMPPTestPDUEventListener pduListener = null;

	/**
	 * The range of addresses the smpp session will serve.
	 */
	AddressRange addressRange = new AddressRange();

	/*
	 * for information about these variables have a look in SMPP 3.4
	 * specification
	 */
	String systemType = "";
	String serviceType = "";
	Address sourceAddress = new Address();
	Address destAddress = new Address();
	String scheduleDeliveryTime = "";
	String validityPeriod = "";
	String shortMessage = "";
	int numberOfDestination = 1;
	String messageId = "";
	byte esmClass = 0;
	byte protocolId = 0;
	byte priorityFlag = 0;
	byte registeredDelivery = 0;
	byte replaceIfPresentFlag = 0;
	byte dataCoding = 0;
	byte smDefaultMsgId = 0;

	/**
	 * If you attemt to receive message, how long will the application
	 * wait for data.
	 */
	long receiveTimeout = Data.RECEIVE_BLOCKING;

	/**
	 * Initialises the application, lods default values for
	 * connection to SMSC and for various PDU fields.
	 */
	public SMPPTest() throws IOException {
		loadProperties(propsFilePath);
	}

	/**
	 * Sets global SMPP library debug and event objects.
	 * Runs the application.
	 * @see SmppObject#setDebug(Debug)
	 * @see SmppObject#setEvent(Event)
	 */
	public static void main(String args[]) {
		System.out.println("Initialising...");
		System.out.println("Charset used: " + new InputStreamReader(System.in).getEncoding());
		debug.activate();
		event.activate();
		SmppObject.setDebug(debug);
		SmppObject.setEvent(event);
		SMPPTest test = null;
		try {
			test = new SMPPTest();
		} catch (IOException e) {
			event.write(e, "");
			debug.write("exception initialising SMPPTest " + e);
			System.out.println("Exception initialising SMPPTest " + e);
		}
		if (test != null) {
			test.menu();
		}
	}

	/**
	 * Displays the menu and lets you choose from available options.
	 */
	public void menu() {
		keepRunning = true;
		String option = "1";
		int optionInt;

		while (keepRunning) {
			System.out.println();
			System.out.println("-  1 bind");
			System.out.println("-  2 submit (t/tr)");
			System.out.println("-  3 submit multi (t/tr)");
			System.out.println("-  4 data (t/tr)");
			System.out.println("-  5 query (t/tr)");
			System.out.println("-  6 replace (t/tr)");
			System.out.println("-  7 cancel (t/tr)");
			System.out.println("-  8 enquire link (t/tr)");
			System.out.println("-  9 unbind");
			System.out.println("- 10 receive message (tr/r)");
			System.out.println("-  0 exit");
			System.out.print("> ");
			optionInt = -1;
			try {
				option = keyboard.readLine();
				optionInt = Integer.parseInt(option);
			} catch (Exception e) {
				debug.write("exception reading keyboard " + e);
				optionInt = -1;
			}
			switch (optionInt) {
				case 1 :
					bind();
					break;
				case 2 :
					submit();
					break;
				case 3 :
					submitMulti();
					break;
				case 4 :
					data();
					break;
				case 5 :
					query();
					break;
				case 6 :
					replace();
					break;
				case 7 :
					cancel();
					break;
				case 8 :
					enquireLink();
					break;
				case 9 :
					unbind();
					break;
				case 10 :
					receive();
					break;
				case 0 :
					exit();
					break;
				case -1 :
					// default option if entering an option went wrong
					break;
				default :
					System.out.println("Invalid option. Choose between 0 and 10.");
					break;
			}
		}
	}

	/**
	 * The first method called to start communication
	 * betwen an ESME and a SMSC. A new instance of <code>TCPIPConnection</code>
	 * is created and the IP address and port obtained from user are passed
	 * to this instance. New <code>Session</code> is created which uses the created
	 * <code>TCPIPConnection</code>.
	 * All the parameters required for a bind are set to the <code>BindRequest</code>
	 * and this request is passed to the <code>Session</code>'s <code>bind</code>
	 * method. If the call is successful, the application should be bound to the SMSC.
	 *
	 * See "SMPP Protocol Specification 3.4, 4.1 BIND Operation."
	 * @see BindRequest
	 * @see BindResponse
	 * @see TCPIPConnection
	 * @see Session#bind(BindRequest)
	 * @see Session#bind(BindRequest,ServerPDUEventListener)
	 */
	private void bind() {
		debug.enter(this, "SMPPTest.bind()");
		try {

			if (bound) {
				System.out.println("Already bound, unbind first.");
				return;
			}

			BindRequest request = null;
			BindResponse response = null;
			String syncMode = (asynchronous ? "a" : "s");

			// type of the session
			syncMode = getParam("Asynchronous/Synchronnous Session? (a/s)", syncMode);
			if (syncMode.compareToIgnoreCase("a") == 0) {
				asynchronous = true;
			} else if (syncMode.compareToIgnoreCase("s") == 0) {
				asynchronous = false;
			} else {
				System.out.println(
					"Invalid mode async/sync, expected a or s, got " + syncMode + ". Operation canceled.");
				return;
			}

			// input values
			bindOption = getParam("Transmitter/Receiver/Transciever (t/r/tr)", bindOption);

			if (bindOption.compareToIgnoreCase("t") == 0) {
				request = new BindTransmitter();
			} else if (bindOption.compareToIgnoreCase("r") == 0) {
				request = new BindReceiver();
			} else if (bindOption.compareToIgnoreCase("tr") == 0) {
				request = new BindTransciever();
			} else {
				System.out.println(
					"Invalid bind mode, expected t, r or tr, got " + bindOption + ". Operation canceled.");
				return;
			}

			ipAddress = getParam("IP address of SMSC", ipAddress);
			port = getParam("Port number", port);

			TCPIPConnection connection = new TCPIPConnection(ipAddress, port);
			connection.setReceiveTimeout(20 * 1000);
			session = new Session(connection);

			systemId = getParam("Your system ID", systemId);
			password = getParam("Your password", password);

			// set values
			request.setSystemId(systemId);
			request.setPassword(password);
			request.setSystemType(systemType);
			request.setInterfaceVersion((byte) 0x34);
			request.setAddressRange(addressRange);

			// send the request
			System.out.println("Bind request " + request.debugString());
			if (asynchronous) {
				pduListener = new SMPPTestPDUEventListener(session);
				response = session.bind(request, pduListener);
			} else {
				response = session.bind(request);
			}
			System.out.println("Bind response " + response.debugString());
			if (response.getCommandStatus() == Data.ESME_ROK) {
				bound = true;
			}

		} catch (Exception e) {
			event.write(e, "");
			debug.write("Bind operation failed. " + e);
			System.out.println("Bind operation failed. " + e);
		} finally {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产aⅴ综合色| 成人黄色小视频| 丁香婷婷综合激情五月色| 日本精品视频一区二区三区| 日韩精品一区国产麻豆| 亚洲国产精品天堂| 成人免费毛片嘿嘿连载视频| 精品久久久久久久一区二区蜜臀| 亚洲欧美综合网| 国产大片一区二区| 日韩欧美黄色影院| 天天综合天天综合色| 91电影在线观看| 欧美国产精品久久| 国产一区二区三区久久悠悠色av| 欧美日韩中文国产| 亚洲成人动漫精品| 91美女视频网站| 国产精品欧美久久久久一区二区| 久久99精品国产麻豆婷婷洗澡| 欧美三级一区二区| 亚洲一区二区av在线| 99re这里都是精品| 一区二区三区精密机械公司| 成人免费高清在线| 欧美高清一级片在线观看| 韩国三级在线一区| 久久日韩粉嫩一区二区三区| 免费成人深夜小野草| 日韩一区二区麻豆国产| 日本中文字幕一区二区有限公司| 欧美另类高清zo欧美| 午夜影院久久久| 在线播放日韩导航| 强制捆绑调教一区二区| 日韩一区二区三区四区| 久久精品国产精品青草| 26uuu精品一区二区在线观看| 精品在线一区二区| 久久久久成人黄色影片| 成人午夜免费视频| 亚洲欧美一区二区三区国产精品| 色噜噜久久综合| 无吗不卡中文字幕| 精品日韩一区二区三区| 国产在线精品一区二区不卡了 | 91色porny在线视频| 亚洲桃色在线一区| 91色porny| 秋霞午夜鲁丝一区二区老狼| 欧美成人女星排行榜| 国产91精品一区二区麻豆网站| 欧美国产日韩a欧美在线观看 | 欧美日韩激情一区| 免费不卡在线视频| 国产精品久久久久久久久免费相片| 91在线视频观看| 丝袜美腿亚洲一区| 国产欧美日韩精品a在线观看| 97精品超碰一区二区三区| 五月天激情综合网| 国产精品网站一区| 这里只有精品免费| 懂色av一区二区三区免费看| 一区二区三区精品在线观看| 日韩一区二区免费高清| av福利精品导航| 欧美aa在线视频| 综合色天天鬼久久鬼色| 欧美精品色一区二区三区| 国产精品77777| 午夜精品爽啪视频| 国产日韩高清在线| 51精品视频一区二区三区| 成人在线视频一区| 日韩成人免费看| 亚洲色欲色欲www| 久久午夜色播影院免费高清| 欧美综合久久久| 国产xxx精品视频大全| 婷婷激情综合网| 亚洲蜜臀av乱码久久精品蜜桃| 日韩视频免费直播| 在线观看国产一区二区| 大陆成人av片| 国产精品一区二区久久不卡| 亚洲国产欧美在线| 日韩伦理av电影| 久久久综合九色合综国产精品| 制服.丝袜.亚洲.另类.中文| 色综合久久久久网| 不卡视频一二三| 国产一区二区在线观看视频| 五月天精品一区二区三区| 一区二区三区四区在线播放| 日韩在线观看一区二区| 综合久久国产九一剧情麻豆| 久久久久久免费网| 日韩免费高清视频| 91精品免费观看| 欧美日本韩国一区二区三区视频 | 精品影视av免费| 日本强好片久久久久久aaa| 天天色天天爱天天射综合| 亚洲精品国产一区二区三区四区在线| 久久久午夜电影| 26uuu国产电影一区二区| 日韩美女视频一区二区在线观看| 欧美乱妇一区二区三区不卡视频 | www.爱久久.com| 不卡一区二区中文字幕| 成人一区二区三区视频在线观看| 国产麻豆精品theporn| 国产成人亚洲综合a∨婷婷图片 | 欧美视频一区二区三区在线观看| 99国产精品久| 欧美在线不卡视频| 欧美色网一区二区| 欧美日韩国产综合视频在线观看| 欧美性生交片4| 欧美精选一区二区| 日韩欧美在线1卡| 精品久久久久一区二区国产| 久久综合一区二区| 久久婷婷色综合| 中文字幕一区不卡| 亚洲欧美国产毛片在线| 亚洲一二三区视频在线观看| 性做久久久久久免费观看| 五月天丁香久久| 国模娜娜一区二区三区| 成人免费视频视频在线观看免费 | 成人精品视频.| 色妹子一区二区| 欧美日本韩国一区| 亚洲精品一区二区三区影院 | 日韩专区中文字幕一区二区| 日韩电影免费在线看| 黄色成人免费在线| 成人性视频免费网站| 色婷婷国产精品综合在线观看| 欧美在线一区二区三区| 日韩精品在线网站| 国产精品久久国产精麻豆99网站| 亚洲一二三级电影| 国产高清精品网站| 欧美亚洲高清一区二区三区不卡| 日韩三级.com| 亚洲男人天堂av| 玖玖九九国产精品| jiyouzz国产精品久久| 欧美丰满一区二区免费视频 | 三级影片在线观看欧美日韩一区二区 | 色成年激情久久综合| 91精品国产麻豆国产自产在线| 国产偷国产偷精品高清尤物| 亚洲另类在线制服丝袜| 国产在线精品一区二区夜色 | 日韩欧美成人一区二区| 亚洲日穴在线视频| 久久不见久久见中文字幕免费| 91猫先生在线| 国产香蕉久久精品综合网| 天天色 色综合| 色综合天天做天天爱| 久久亚洲综合色| 日韩国产欧美在线视频| 99国内精品久久| 久久尤物电影视频在线观看| 亚洲一区二三区| 成人的网站免费观看| 久久一区二区视频| 日韩高清不卡在线| 在线观看av一区二区| 中文字幕欧美国产| 精品亚洲国产成人av制服丝袜| 欧美色爱综合网| 一级中文字幕一区二区| 成人免费看片app下载| 精品国产1区二区| 奇米888四色在线精品| 精品视频999| 亚洲国产va精品久久久不卡综合| 成人激情午夜影院| 中文字幕久久午夜不卡| 国产精品一品二品| 国产午夜精品一区二区三区视频| 久久精品国产亚洲a| 日韩欧美一二三区| 六月丁香婷婷久久| 欧美一区二区三区思思人| 亚洲成人精品影院| 欧美精品一级二级| 日本成人在线网站| 欧美一区二区精品久久911| 日本视频中文字幕一区二区三区| 在线亚洲欧美专区二区| 一区二区三区在线高清| 色天天综合色天天久久| 亚洲成av人在线观看|