[SNMP4J] Re: Send Trap: How Change the Sender port
Smart Bart
smartbart1701e at gmail.com
Mon Feb 11 23:14:36 CET 2008
I've found the solution:
UdpAddress addrs = new UdpAddress();
addrs.setPort(9876);
DefaultUdpTransportMapping udpTransportMap = new
DefaultUdpTransportMapping(addrs);
Thanks
smart bart ha scritto:
> Hi all,
>
> I've try to send a Trap with this code:
>
> DefaultUdpTransportMapping udpTransportMap = new DefaultUdpTransportMapping();
> udpTransportMap.getAddress().setPort(9876);
> Snmp snmp = new Snmp(udpTransportMap);
> ResponseEvent response = snmp.send(pdu, target, udpTransportMap);
> System.out.println("pdu:" + pdu);
> System.out.println("response:" + response);
> snmp.close();
>
> but the sender port seems always 32770.
>
> Is possible change the sender port?
>
> Thanks alot
>
> Smart
>
>
More information about the SNMP4J
mailing list