Hello,

I think I have found a bug in SNMP4J (2.3.3) where we can have a 
"BindException: Address already in use" exception when creating a 
DefaultUdpTransportMapping, whereas reuseAddress=true, if we have previously 
created and closed a similar DefaultUdpTransportMapping.
In DefaultUdpTransportMapping.close(), the listener thread (WorkerTask) is not 
"joined", so it can still use the UDP port for some time, and creating a new 
DefaultUdpTransportMapping on the same port, even if reuseAddress=true, is not 
possible.
My current dirty workaround is to access the "WorkerTask" field by reflection 
just before closing the Snmp object, and then calling "join()" on the object, 
so I am sure the thread is correctly terminated before any new attempt to 
create a new DefaultUdpTransportMapping.

Can this problem be solved in the next version of SNM4J?

Regards,
Thomas
_______________________________________________
SNMP4J mailing list
[email protected]
https://oosnmp.net/mailman/listinfo/snmp4j

Reply via email to