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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? smpptest.java

?? Short Message Peer to Peer
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
				messageId = response.getMessageId();
			}

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

	/**
	 * Creates a new instance of <code>EnquireSM</code> class.
	 * This PDU is used to check that application level of the other party
	 * is alive. It can be sent both by SMSC and ESME.
	 *
	 * See "SMPP Protocol Specification 3.4, 4.11 ENQUIRE_LINK Operation."
	 * @see Session#enquireLink(EnquireLink)
	 * @see EnquireLink
	 * @see EnquireLinkResp
	 */
	private void enquireLink() {
		debug.enter(this, "SMPPTest.enquireLink()");
		try {

			EnquireLink request = new EnquireLink();
			EnquireLinkResp response;
			System.out.println("Enquire Link request " + request.debugString());
			if (asynchronous) {
				session.enquireLink(request);
			} else {
				response = session.enquireLink(request);
				System.out.println("Enquire Link response " + response.debugString());
			}

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

	/**
	 * Receives one PDU of any type from SMSC and prints it on the screen.
	 * @see Session#receive()
	 * @see Response
	 * @see ServerPDUEvent
	 */
	private void receive() {
		debug.enter(this, "SMPPTest.receive()");
		try {

			PDU pdu = null;
			System.out.print("Going to receive a PDU. ");
			if (receiveTimeout == Data.RECEIVE_BLOCKING) {
				System.out.print(
					"The receive is blocking, i.e. the application " + "will stop until a PDU will be received.");
			} else {
				System.out.print("The receive timeout is " + receiveTimeout / 1000 + " sec.");
			}
			System.out.println();
			if (asynchronous) {
				ServerPDUEvent pduEvent = pduListener.getRequestEvent(receiveTimeout);
				if (pduEvent != null) {
					pdu = pduEvent.getPDU();
				}
			} else {
				pdu = session.receive(receiveTimeout);
			}
			if (pdu != null) {
				System.out.println("Received PDU " + pdu.debugString());
				if (pdu.isRequest()) {
					Response response = ((Request) pdu).getResponse();
					// respond with default response
					System.out.println("Going to send default response to request " + response.debugString());
					session.respond(response);
				}
			} else {
				System.out.println("No PDU received this time.");
			}

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

	/**
	 * If bound, unbinds and then exits this application.
	 */
	private void exit() {
		debug.enter(this, "SMPPTest.exit()");
		if (bound) {
			unbind();
		}
		keepRunning = false;
		debug.exit(this);
	}

	/**
	 * Implements simple PDU listener which handles PDUs received from SMSC.
	 * It puts the received requests into a queue and discards all received
	 * responses. Requests then can be fetched (should be) from the queue by
	 * calling to the method <code>getRequestEvent</code>.
	 * @see Queue
	 * @see ServerPDUEvent
	 * @see ServerPDUEventListener
	 * @see SmppObject
	 */
	private class SMPPTestPDUEventListener extends SmppObject implements ServerPDUEventListener {
		Session session;
		Queue requestEvents = new Queue();

		public SMPPTestPDUEventListener(Session session) {
			this.session = session;
		}

		public void handleEvent(ServerPDUEvent event) {
			PDU pdu = event.getPDU();
			if (pdu.isRequest()) {
				System.out.println("async request received, enqueuing " + pdu.debugString());
				synchronized (requestEvents) {
					requestEvents.enqueue(event);
					requestEvents.notify();
				}
			} else if (pdu.isResponse()) {
				System.out.println("async response received " + pdu.debugString());
			} else {
				System.out.println(
					"pdu of unknown class (not request nor " + "response) received, discarding " + pdu.debugString());
			}
		}

		/**
		 * Returns received pdu from the queue. If the queue is empty,
		 * the method blocks for the specified timeout.
		 */
		public ServerPDUEvent getRequestEvent(long timeout) {
			ServerPDUEvent pduEvent = null;
			synchronized (requestEvents) {
				if (requestEvents.isEmpty()) {
					try {
						requestEvents.wait(timeout);
					} catch (InterruptedException e) {
						// ignoring, actually this is what we're waiting for
					}
				}
				if (!requestEvents.isEmpty()) {
					pduEvent = (ServerPDUEvent) requestEvents.dequeue();
				}
			}
			return pduEvent;
		}
	}

	/**
	 * Prompts the user to enter a string value for a parameter.
	 */
	private String getParam(String prompt, String defaultValue) {
		String value = "";
		String promptFull = prompt;
		promptFull += defaultValue == null ? "" : " [" + defaultValue + "] ";
		System.out.print(promptFull);
		try {
			value = keyboard.readLine();
		} catch (IOException e) {
			event.write(e, "");
			debug.write("Got exception getting a param. " + e);
		}
		if (value.compareTo("") == 0) {
			return defaultValue;
		} else {
			return value;
		}
	}

	/**
	 * Prompts the user to enter a byte value for a parameter.
	 */
	private byte getParam(String prompt, byte defaultValue) {
		return Byte.parseByte(getParam(prompt, Byte.toString(defaultValue)));
	}

	/**
	 * Prompts the user to enter an integer value for a parameter.
	 */
	private int getParam(String prompt, int defaultValue) {
		return Integer.parseInt(getParam(prompt, Integer.toString(defaultValue)));
	}

	/**
	 * Prompts the user to enter an address value with specified max length.
	 */
	private Address getAddress(String type, Address address, int maxAddressLength)
		throws WrongLengthOfStringException {
		byte ton = getParam(type + " address TON", address.getTon());
		byte npi = getParam(type + " address NPI", address.getNpi());
		String addr = getParam(type + " address", address.getAddress());
		address.setTon(ton);
		address.setNpi(npi);
		address.setAddress(addr, maxAddressLength);
		return address;
	}

	/**
	 * Prompts the user to enter an address value with max length set to the
	 * default length Data.SM_ADDR_LEN.
	 */
	private Address getAddress(String type, Address address) throws WrongLengthOfStringException {
		return getAddress(type, address, Data.SM_ADDR_LEN);
	}

	/**
	 * Loads configuration parameters from the file with the given name.
	 * Sets private variable to the loaded values.
	 */
	private void loadProperties(String fileName) throws IOException {
		System.out.println("Reading configuration file " + fileName + "...");
		FileInputStream propsFile = new FileInputStream(fileName);
		properties.load(propsFile);
		propsFile.close();
		System.out.println("Setting default parameters...");
		byte ton;
		byte npi;
		String addr;
		String bindMode;
		int rcvTimeout;
		String syncMode;

		ipAddress = properties.getProperty("ip-address");
		port = getIntProperty("port", port);
		systemId = properties.getProperty("system-id");
		password = properties.getProperty("password");

		ton = getByteProperty("addr-ton", addressRange.getTon());
		npi = getByteProperty("addr-npi", addressRange.getNpi());
		addr = properties.getProperty("address-range", addressRange.getAddressRange());
		addressRange.setTon(ton);
		addressRange.setNpi(npi);
		try {
			addressRange.setAddressRange(addr);
		} catch (WrongLengthOfStringException e) {
			System.out.println("The length of address-range parameter is wrong.");
		}

		ton = getByteProperty("source-ton", sourceAddress.getTon());
		npi = getByteProperty("source-npi", sourceAddress.getNpi());
		addr = properties.getProperty("source-address", sourceAddress.getAddress());
		setAddressParameter("source-address", sourceAddress, ton, npi, addr);

		ton = getByteProperty("destination-ton", destAddress.getTon());
		npi = getByteProperty("destination-npi", destAddress.getNpi());
		addr = properties.getProperty("destination-address", destAddress.getAddress());
		setAddressParameter("destination-address", destAddress, ton, npi, addr);

		serviceType = properties.getProperty("service-type", serviceType);
		systemType = properties.getProperty("system-type", systemType);
		bindMode = properties.getProperty("bind-mode", bindOption);
		if (bindMode.equalsIgnoreCase("transmitter")) {
			bindMode = "t";
		} else if (bindMode.equalsIgnoreCase("receiver")) {
			bindMode = "r";
		} else if (bindMode.equalsIgnoreCase("transciever")) {
			bindMode = "tr";
		} else if (
			!bindMode.equalsIgnoreCase("t") && !bindMode.equalsIgnoreCase("r") && !bindMode.equalsIgnoreCase("tr")) {
			System.out.println(
				"The value of bind-mode parameter in "
					+ "the configuration file "
					+ fileName
					+ " is wrong. "
					+ "Setting the default");
			bindMode = "t";
		}
		bindOption = bindMode;

		// receive timeout in the cfg file is in seconds, we need milliseconds
		// also conversion from -1 which indicates infinite blocking
		// in the cfg file to Data.RECEIVE_BLOCKING which indicates infinite
		// blocking in the library is needed.
		if (receiveTimeout == Data.RECEIVE_BLOCKING) {
			rcvTimeout = -1;
		} else {
			rcvTimeout = ((int) receiveTimeout) / 1000;
		}
		rcvTimeout = getIntProperty("receive-timeout", rcvTimeout);
		if (rcvTimeout == -1) {
			receiveTimeout = Data.RECEIVE_BLOCKING;
		} else {
			receiveTimeout = rcvTimeout * 1000;
		}

		syncMode = properties.getProperty("sync-mode", (asynchronous ? "async" : "sync"));
		if (syncMode.equalsIgnoreCase("sync")) {
			asynchronous = false;
		} else if (syncMode.equalsIgnoreCase("async")) {
			asynchronous = true;
		} else {
			asynchronous = false;
		}

		/*
		scheduleDeliveryTime
		validityPeriod
		shortMessage
		numberOfDestination
		messageId
		esmClass
		protocolId
		priorityFlag
		registeredDelivery
		replaceIfPresentFlag
		dataCoding
		smDefaultMsgId
		*/
	}

	/**
	 * Gets a property and converts it into byte.
	 */
	private byte getByteProperty(String propName, byte defaultValue) {
		return Byte.parseByte(properties.getProperty(propName, Byte.toString(defaultValue)));
	}

	/**
	 * Gets a property and converts it into integer.
	 */
	private int getIntProperty(String propName, int defaultValue) {
		return Integer.parseInt(properties.getProperty(propName, Integer.toString(defaultValue)));
	}

	/**
	 * Sets attributes of <code>Address</code> to the provided values.
	 */
	private void setAddressParameter(String descr, Address address, byte ton, byte npi, String addr) {
		address.setTon(ton);
		address.setNpi(npi);
		try {
			address.setAddress(addr);
		} catch (WrongLengthOfStringException e) {
			System.out.println("The length of " + descr + " parameter is wrong.");
		}
	}
}
/*
 * $Log: SMPPTest.java,v $
 * Revision 1.2  2003/09/30 09:07:32  sverkera
 * Changed to use GSM 7Bit charset
 *
 * Revision 1.1  2003/07/23 00:28:39  sverkera
 * Imported
 *
 * 
 * Old changelog:
 * 15-09-01 ticp@logica.com added asynchronous processing capability
 *                          as the library has this feature now
 * 10-10-01 ticp@logica.com file moved to package com.logica.smpp.test,
 *                          old package com.logica.smpptest not used anymore
 * 11-10-01 ticp@logica.com the max address length checking reflected
 * 11-10-01 ticp@logica.com added commants
 */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
麻豆精品一区二区av白丝在线| 中文字幕亚洲一区二区va在线| 一区二区在线观看av| 成人污污视频在线观看| 久久久久久久久岛国免费| 久草热8精品视频在线观看| 日韩欧美一区二区不卡| 国产一区二区调教| 国产三级精品三级| thepron国产精品| 亚洲精品综合在线| 欧美男人的天堂一二区| 麻豆91在线看| 国产精品成人免费在线| 欧美性受xxxx| 久久国产精品免费| 成人免费一区二区三区视频| 欧美影院一区二区三区| 麻豆成人91精品二区三区| 伊人夜夜躁av伊人久久| 51午夜精品国产| 成人综合在线网站| 亚洲一区av在线| 国产欧美一区视频| 51精品国自产在线| 91一区二区三区在线观看| 亚洲国产日韩一级| 国产午夜精品久久久久久免费视 | 欧美日韩免费一区二区三区视频| 亚洲一区二区三区四区五区黄 | 色婷婷综合久久久久中文| 中文字幕第一区二区| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 欧美午夜理伦三级在线观看| 国产伦精品一区二区三区视频青涩| 麻豆成人免费电影| 久久久久久久综合日本| 国产福利一区二区三区视频 | 亚洲欧美一区二区不卡| 91精品国产一区二区人妖| 国产a视频精品免费观看| 亚洲小说春色综合另类电影| 久久久99精品久久| 在线不卡a资源高清| 成人国产精品免费观看| 久久er精品视频| 丝袜美腿亚洲一区| 一区二区在线观看免费视频播放| 久久蜜臀中文字幕| 日韩欧美在线观看一区二区三区| 欧美丰满少妇xxxbbb| 国产剧情一区在线| 精品一区二区三区在线视频| 91视频一区二区| www.在线欧美| 欧美日韩不卡在线| 日韩欧美在线一区二区三区| 久久久久久久久久美女| 国产嫩草影院久久久久| 国产精品久久毛片| 亚洲免费在线看| 视频一区二区三区在线| 久久精品国产99| 岛国精品在线观看| 日本韩国一区二区三区视频| 欧美日韩国产一二三| 欧美视频在线一区| 国产午夜精品久久久久久久| 国产精品久久久久久久久久久免费看 | 亚洲免费高清视频在线| 免费av成人在线| 国产91在线|亚洲| 欧美日韩国产精品自在自线| 久久久久国产精品麻豆| 婷婷丁香激情综合| 欧美无乱码久久久免费午夜一区| 制服丝袜亚洲网站| 亚洲尤物视频在线| 成人动漫在线一区| 亚洲日本va午夜在线影院| 国产精品日产欧美久久久久| 国产欧美1区2区3区| 国产999精品久久久久久| 中文av字幕一区| 91成人在线精品| 狠狠色综合日日| 国产精品久久久久久久久搜平片| 欧洲av在线精品| 亚洲一区视频在线| 欧美亚洲图片小说| 亚洲mv大片欧洲mv大片精品| 日本久久电影网| 五月婷婷久久丁香| 欧美三级日韩三级国产三级| 亚洲免费毛片网站| 色香色香欲天天天影视综合网| 国产精品初高中害羞小美女文| 成人午夜短视频| 国产欧美精品一区二区色综合| 国产乱子伦一区二区三区国色天香| 91精品国产综合久久久蜜臀粉嫩| 午夜欧美大尺度福利影院在线看| 欧美色综合网站| 精品一二线国产| 国产精品高清亚洲| 91黄色激情网站| 麻豆精品新av中文字幕| 久久精品免视看| 色综合久久六月婷婷中文字幕| 三级影片在线观看欧美日韩一区二区| 日韩一区二区电影在线| 国产在线播放一区三区四| 中文字幕欧美日韩一区| 色999日韩国产欧美一区二区| 久久99热这里只有精品| 日本一区二区成人| av中文字幕一区| 国产精品一区二区三区四区| 国产精品久久福利| 26uuu欧美| 欧美日本精品一区二区三区| 精品亚洲欧美一区| 亚洲永久免费av| 日韩一级二级三级精品视频| 国产91清纯白嫩初高中在线观看| 亚洲永久精品大片| 欧美激情一区三区| 欧美xxx久久| 在线免费观看成人短视频| 蜜桃视频一区二区| 亚洲激情在线激情| 欧美国产一区视频在线观看| 精品影院一区二区久久久| 欧美三日本三级三级在线播放| 五月开心婷婷久久| 中文字幕日韩一区| 精品精品国产高清一毛片一天堂| 91在线高清观看| 成人激情动漫在线观看| 青青草国产精品亚洲专区无| 一区二区三区在线不卡| 国产精品毛片无遮挡高清| 国产偷v国产偷v亚洲高清| 日韩午夜激情视频| 日韩一区二区三区在线观看| 欧美三级韩国三级日本一级| a级高清视频欧美日韩| 国产乱码精品一区二区三区忘忧草| 亚洲高清中文字幕| 免费精品视频在线| 国模无码大尺度一区二区三区| 久久9热精品视频| 丁香一区二区三区| 欧美日韩中文字幕精品| 欧美日韩国产在线播放网站| 日韩视频免费直播| 一区二区三区四区高清精品免费观看 | 亚洲天堂av一区| 亚洲午夜久久久久久久久久久| 日韩不卡一区二区| 九九热在线视频观看这里只有精品| 亚洲已满18点击进入久久| 亚洲毛片av在线| 日韩在线一区二区| 久久精品噜噜噜成人88aⅴ| 美国av一区二区| 国产aⅴ综合色| 91国内精品野花午夜精品 | 国产精品资源在线| 99re视频精品| 日韩一本二本av| 亚洲国产成人私人影院tom| 国产精品久久毛片av大全日韩| 亚洲最色的网站| 国产美女娇喘av呻吟久久| 91国偷自产一区二区开放时间 | 夜夜夜精品看看| 国产精品亚洲成人| 欧美色爱综合网| 中文av一区二区| 美女性感视频久久| 国产精品一二三四区| 欧美日韩色一区| 国产精品美女久久久久久久久久久| 亚洲成人午夜电影| 一本久久综合亚洲鲁鲁五月天| 欧美日韩一二区| 亚洲精品国产一区二区三区四区在线| 久久se精品一区精品二区| 在线观看91视频| 亚洲免费在线观看| 99re视频精品| 国产精品美女www爽爽爽| 激情综合色综合久久综合| 欧美自拍丝袜亚洲| 亚洲男女毛片无遮挡| 91视频免费看| 亚洲精品中文在线| 91色|porny| 中文字幕日韩欧美一区二区三区|