Can I use a TransportMapping with two Snmp instances?

Last modified by Frank Fock on 2024/05/25 20:49

Although it is recommended to use only a single Snmp instance with one or more TransportMappings, you can also use a single TransportMapping instance with more than one Snmp instance. 

You probably need to implement your own MessageDispatcher then, to properly dispatch incoming messages to avoid timeouts because a response is processed by a different Snmp instance than the instance that sent the corresponding request. 

When using the DefaultUdpTransportMapping you also need to call

transport.setAsyncMsgProcessingSupported(true);

before 

transport.listen();

or 

snmp.listen();

To avoid parallel access to the transport mappings message buffer.