// We set the priority of the DaemonTaskServer to
// Thread.NORM_PRIORITY so that emptying the socket takes
// precedence over trap processing.
//
final DaemonTaskServer taskServer = new DaemonTaskServer();
taskServer.start(Thread.NORM_PRIORITY);
// Create a listener and dispatcher for SNMP traps
// (SnmpEventReportDispatcher).
// SnmpEventReportDispatcher is run as a thread and listens
// for traps in UDP port = agent port + 1.