Introduction - If you have any usage issues, please Google them yourself
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.