Hi David,
SNMP4J 2.5.0 will provide alternative and symmetric notification
listener accessors.
So you can then use your own TransportMapping.
Alternatively, you can use a MessageDispatcher to register a
CommandResponder
with a TransportMapping.
The SocketEntry will be removed on remote socket closing in SNMP4J 2.5.0
too.
You can download the latest 2.5 snapshot from:
https://oosnmp.net/dist/snapshot/org/snmp4j/snmp4j/2.5.0-SNAPSHOT/
Best regards,
Frank
Am 16.03.2016 um 20:47 schrieb David Allen:
Hi -
I am trying to implement a trap handler over TCP and have run into a couple of
issues.
The first is that the incoming messages can be much larger than the default
returned by getMaxInboundMessageSize. There is a mechanism to set a value in
the DefaultTcpTransportMapping, but no way to get the transport mapping that is
created when registering a notification listener using
Snmp.addNotificationListener. I could create a custom transport mapping that
extends the default and register it with the TransportMappings, but I only want
to extend the size for this one case - I don't want any other connections to
use this extra memory (although I don't think there will be many that use TCP).
Is there a way for me to access the transport mapping? Alternatively is there a
way to register a CommandResponder with the transport mapping? If there is no
current mechanism, would it be worthwhile to create another method on Snmp to
return the transport mapping?
The second issue is that it looks like the DefaultTcpTransportMapping will leak
SocketEntry objects for a notification listener if the remote connection is
closed. I don't see anywhere that the sockets map is cleaned up until the
server connection itself is closed. I can see this in both the heap dump and
also the debug when the connection is closed and all of the previously
connected socket entries are cleaned up. My thought is that the entry should be
removed when socketClosedRemotely is invoked.
Thank you,
David
_______________________________________________
SNMP4J mailing list
SNMP4J@agentpp.org
https://oosnmp.net/mailman/listinfo/snmp4j
--
---
AGENT++
Maximilian-Kolbe-Str. 10
73257 Koengen, Germany
https://agentpp.com
Phone: +49 7024 8688230
Fax: +49 7024 8688231
_______________________________________________
SNMP4J mailing list
SNMP4J@agentpp.org
https://oosnmp.net/mailman/listinfo/snmp4j