亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
色婷婷综合久久久久中文| 综合久久久久久| 欧美精品丝袜中出| 欧美色区777第一页| 欧美午夜精品久久久| 色妹子一区二区| 91丨九色丨国产丨porny| 高清日韩电视剧大全免费| 国产精品综合久久| 丁香一区二区三区| 福利一区二区在线| 成人高清免费在线播放| 99久久精品国产一区二区三区 | 99免费精品视频| av电影在线观看完整版一区二区| va亚洲va日韩不卡在线观看| 91老师片黄在线观看| 色吊一区二区三区| 欧美日韩国产天堂| 日韩欧美成人激情| 久久综合九色综合97_久久久| 国产三区在线成人av| 中文字幕一区在线观看| 亚洲一区在线看| 免费在线观看一区| 国产精品99久久久久久有的能看| av色综合久久天堂av综合| 欧美亚洲动漫另类| 日韩美女在线视频| 国产精品美女久久久久aⅴ | 亚洲国产乱码最新视频 | 国产成人综合在线观看| www.成人在线| 欧美日本一区二区三区| 精品成人私密视频| 日韩一区在线免费观看| 一区二区三区在线高清| 肉丝袜脚交视频一区二区| 国模冰冰炮一区二区| 99在线精品免费| 555www色欧美视频| 国产精品久久久久一区二区三区共| 亚洲日本va午夜在线影院| 青青草97国产精品免费观看无弹窗版| 国产精品1区2区3区在线观看| 在线视频中文字幕一区二区| 欧美mv日韩mv国产网站app| 日韩美女视频一区| 美脚の诱脚舐め脚责91 | 欧美优质美女网站| 色伊人久久综合中文字幕| 成人黄色电影在线| 欧美福利视频一区| 国产a久久麻豆| 美女一区二区视频| 奇米亚洲午夜久久精品| 成人黄色av网站在线| 欧美精品在线视频| 国产精品三级电影| 乱一区二区av| 色婷婷国产精品| 久久久www成人免费无遮挡大片| 亚洲一区二区三区中文字幕 | 国产伦精品一区二区三区免费| jlzzjlzz欧美大全| 日韩精品一区二区三区三区免费| 亚洲欧美在线视频| 国产一区二区成人久久免费影院| 欧美性淫爽ww久久久久无| 久久久久久久性| 亚洲成人av福利| gogogo免费视频观看亚洲一| www亚洲一区| 日韩av高清在线观看| 91蜜桃婷婷狠狠久久综合9色| 久久奇米777| 91女神在线视频| 亚洲欧洲av色图| 国产乱码精品一区二区三区忘忧草| 欧美亚洲愉拍一区二区| 国产精品午夜在线| 国产一区二区精品久久91| 欧美一区二区美女| 亚洲最色的网站| 99久久久无码国产精品| 久久精品一区蜜桃臀影院| 免费观看一级特黄欧美大片| 欧美日韩成人高清| 一区二区欧美国产| 一本到高清视频免费精品| 国产日韩欧美精品一区| 国产精品一区二区无线| 精品国产网站在线观看| 欧美aaa在线| 91精品国产欧美一区二区成人| 午夜精品影院在线观看| 欧美日韩小视频| 亚洲成人自拍网| 欧美亚洲愉拍一区二区| 亚洲综合精品久久| 欧美在线999| 婷婷综合另类小说色区| 欧美日韩国产一二三| 三级久久三级久久久| 欧美疯狂性受xxxxx喷水图片| 亚洲bt欧美bt精品777| 欧美精品99久久久**| 日韩中文字幕亚洲一区二区va在线 | 成人免费一区二区三区在线观看| 国产成人免费xxxxxxxx| 久久精品亚洲麻豆av一区二区| 国模套图日韩精品一区二区| 国产亚洲一区二区在线观看| 成人禁用看黄a在线| 亚洲女性喷水在线观看一区| 91久久精品一区二区三| 亚洲午夜电影在线| 色哟哟国产精品免费观看| 亚洲一区在线免费观看| 91精品国产综合久久福利软件| 麻豆久久一区二区| 久久久久久久久岛国免费| 粉嫩在线一区二区三区视频| 国产精品久久久久aaaa| 色婷婷国产精品综合在线观看| 午夜国产精品影院在线观看| 日韩一二三区视频| 国产一区二区在线视频| 国产精品女主播av| 色久综合一二码| 蜜臂av日日欢夜夜爽一区| 欧美国产日韩一二三区| 91香蕉视频在线| 日韩av中文字幕一区二区三区 | 日本va欧美va欧美va精品| 亚洲精品一区二区三区香蕉| 成人18精品视频| 亚洲超碰97人人做人人爱| 日韩精品在线一区二区| 成人免费高清视频| 亚洲gay无套男同| 久久综合色之久久综合| 色一情一乱一乱一91av| 久久不见久久见免费视频7| 国产三级精品三级在线专区| 日本久久一区二区三区| 另类小说视频一区二区| 国产精品国产三级国产a| 欧美日韩国产欧美日美国产精品| 国内久久婷婷综合| 亚洲黄色片在线观看| 日韩免费看的电影| 99久久精品99国产精品| 麻豆91在线看| 亚洲精品国久久99热| 久久久久久久综合狠狠综合| 欧美日韩在线播| 成人手机电影网| 蜜桃视频免费观看一区| 亚洲欧美乱综合| 久久综合九色综合久久久精品综合| 在线免费观看成人短视频| 韩国av一区二区| 午夜精品久久久久久久99樱桃| 欧美激情一区不卡| 7777精品伊人久久久大香线蕉的 | 日本福利一区二区| 国产一区二区三区免费在线观看| 亚洲精品成人天堂一二三| 精品欧美久久久| 欧美午夜不卡视频| eeuss国产一区二区三区| 麻豆久久久久久| 午夜视频一区二区| 中文字幕人成不卡一区| 精品国产一区久久| 欧美日韩一卡二卡三卡| 成人性视频网站| 久久超碰97人人做人人爱| 一区二区三区中文在线| 中文字幕欧美激情| 精品日韩一区二区| 欧美一区二区在线视频| 欧美影院午夜播放| 一本色道久久加勒比精品| 国产99久久久国产精品潘金 | 成人一级片在线观看| 久久精品国产免费看久久精品| 一个色妞综合视频在线观看| 中文字幕成人av| 久久精品夜色噜噜亚洲aⅴ| 精品国产污污免费网站入口 | 国产91综合网| 国产一区欧美二区| 精品一区二区三区影院在线午夜| 日韩av在线免费观看不卡| 午夜在线电影亚洲一区| 亚洲电影欧美电影有声小说| 一区二区三区在线观看视频| 亚洲欧美综合另类在线卡通|