文件名称:SNMP_DEMO
-
所属分类:
- 标签属性:
- 上传时间:2012-10-24
-
文件大小:301.16kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
本程序很简单总共涉及到三个类,分别是Receiver (Trap接收者), Sender (Trap发送者), Startup(启动类)。
Receiver会实例化Snmp,并设定好IP,端口及监听程序,之后调用listen方法开始接收Trap。这边main方法最后会起一个用户线程,是为了让接收程序一直处于运行状态。
Sender会实例化Snmp,并实例化CommunityTarget类,这个类描述了发送目标的IP,端口等信息。然后实例化一个PDU类,里面设定了OID和变量值,最后通过Snmp对象调用send方法来实现Trap的发送。这里程序会发10个Trap作为测试。
Startup用来启动整个测试程序,它会先调Receiver.main,再调Sender.main。
-This procedure is very simple involving a total of three categories, namely Receiver (Trap receiver), Sender (Trap sender), Startup (start class). Receiver will be instantiated Snmp, and set the IP, port and the listener, and then call the listen method to start receiving Trap. Here will play a main method of the last user thread is to allow the receiving program has been running. Sender will be instantiated Snmp, and instantiate CommunityTarget class that describes the transmission target IP, port and other information. PDU and then instantiate a class, which set the OID and variable values, and finally call the send method of the object through Snmp Trap sending to achieve. This program will send 10 Trap as a test. Startup to start the test program, it will be transferred Receiver.main, and then transferred Sender.main.
Receiver会实例化Snmp,并设定好IP,端口及监听程序,之后调用listen方法开始接收Trap。这边main方法最后会起一个用户线程,是为了让接收程序一直处于运行状态。
Sender会实例化Snmp,并实例化CommunityTarget类,这个类描述了发送目标的IP,端口等信息。然后实例化一个PDU类,里面设定了OID和变量值,最后通过Snmp对象调用send方法来实现Trap的发送。这里程序会发10个Trap作为测试。
Startup用来启动整个测试程序,它会先调Receiver.main,再调Sender.main。
-This procedure is very simple involving a total of three categories, namely Receiver (Trap receiver), Sender (Trap sender), Startup (start class). Receiver will be instantiated Snmp, and set the IP, port and the listener, and then call the listen method to start receiving Trap. Here will play a main method of the last user thread is to allow the receiving program has been running. Sender will be instantiated Snmp, and instantiate CommunityTarget class that describes the transmission target IP, port and other information. PDU and then instantiate a class, which set the OID and variable values, and finally call the send method of the object through Snmp Trap sending to achieve. This program will send 10 Trap as a test. Startup to start the test program, it will be transferred Receiver.main, and then transferred Sender.main.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
lib/SNMP4J.jar
src/com/broada/demo/snmp/Receiver.java
src/com/broada/demo/snmp/Sender.java
src/com/broada/demo/snmp/Startup.java
.classpath
.project
classes/com/broada/demo/snmp/Receiver$1.class
classes/com/broada/demo/snmp/Receiver$2.class
classes/com/broada/demo/snmp/Receiver.class
classes/com/broada/demo/snmp/Sender.class
classes/com/broada/demo/snmp/Startup.class
src/com/broada/demo/snmp
classes/com/broada/demo/snmp
src/com/broada/demo
classes/com/broada/demo
src/com/broada
classes/com/broada
src/com
classes/com
lib
src
classes
src/com/broada/demo/snmp/Receiver.java
src/com/broada/demo/snmp/Sender.java
src/com/broada/demo/snmp/Startup.java
.classpath
.project
classes/com/broada/demo/snmp/Receiver$1.class
classes/com/broada/demo/snmp/Receiver$2.class
classes/com/broada/demo/snmp/Receiver.class
classes/com/broada/demo/snmp/Sender.class
classes/com/broada/demo/snmp/Startup.class
src/com/broada/demo/snmp
classes/com/broada/demo/snmp
src/com/broada/demo
classes/com/broada/demo
src/com/broada
classes/com/broada
src/com
classes/com
lib
src
classes
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.