I manage to set the desire source port to 2000, just added this code
"new UdpAddress(2000)"
Below show the code before modify and after modify. Anyone can give
comment on this code? Any concern could be rise up or enchancement
that can be apply?
Before:
try {
transport = new DefaultUdpTransportMapping();
} catch (IOException e1) {
System.out.println(e1.getMessage());
e1.printStackTrace();
}
snmp = new Snmp(transport);
usm = new USM(SecurityProtocols.getInstance(),
new OctetString(MPv3.createLocalEngineID()), 0);
SecurityModels.getInstance().addSecurityModel(usm);
try {
transport.listen();
} catch (IOException e1) {
e1.printStackTrace();
}
After:
try {
transport = new DefaultUdpTransportMapping(new UdpAddress(2000));
} catch (IOException e1) {
System.out.println(e1.getMessage());
e1.printStackTrace();
}
snmp = new Snmp(transport);
usm = new USM(SecurityProtocols.getInstance(),
new OctetString(MPv3.createLocalEngineID()), 0);
SecurityModels.getInstance().addSecurityModel(usm);
try {
transport.listen();
} catch (IOException e1) {
e1.printStackTrace();
}
--
Thanks and Regards,
Samuel Tan
[email protected]
_______________________________________________
SNMP4J mailing list
[email protected]
http://lists.agentpp.org/mailman/listinfo/snmp4j