[SNMP4J] Listening for traps on different port or interfaces

Matthieu Casanova chocolat.mou at gmail.com
Thu Sep 6 09:40:14 CEST 2007


Hi, I would like to listen for traps on different ports, but when I
add the TransportMapping to the Snmp :
snmp.addTransportMapping(new DefaultUdpTransportMapping(....))
snmp.addTransportMapping(new DefaultUdpTransportMapping(....))

only the first one is added because the addTransportMapping method of
the MessageDispatcherImpl is like that :
public void addTransportMapping(TransportMapping transport) {
    if (transportMappings.get(transport.getSupportedAddressClass()) == null) {
      transportMappings.put(transport.getSupportedAddressClass(), transport);
    }
  }

So If I understand well I can only have one
DefaultUdpTransportMapping. But is there a reason for that ?
Thanks

Matthieu



More information about the SNMP4J mailing list