[SNMP4J] Freezing when creating an Snmp object

Norman Elton normelton at gmail.com
Mon Jun 13 23:28:37 CEST 2005


Frank,

I've copied the DefaultUdpTransportMapping to a new class and have  
called SetReuseAddress(true) immediately after creating the socket.  
This does not appear to fix the problem.

Any other ideas?

Thanks,

Norman


On Jun 13, 2005, at 4:19 PM, Frank Fock wrote:

> Norman,
>
> I do not think that this problem is related to SNMP4J. What
> operating system are you using? There are some OS where
> reusing IP sockets may take some time. See Socket.setReuseAddress
> for more information on this. SNMP4J does not set this option.
> If you need it on your system, you may create your own transport  
> mapping
> subclass.
>
> Best regards,
> Frank
>
> Norman Elton wrote:
>
>
>> I've got the following three lines of code...
>>
>> TransportMapping transport = new DefaultUdpTransportMapping();
>> snmp = new Snmp(transport);
>> transport.listen();
>>
>> For some reason, the code tends to hang for anywhere from 2-30   
>> seconds after I call the second line. I've diagnosed this by  
>> putting  System.out calls in between each line.
>>
>> I've noticed that this problem is more reproducible if I execute  
>> my  program immediately after it stops. If I wait a few minutes,  
>> the code  runs as expected. I am calling snmp.close() before  
>> exiting, to close  any sockets and stop the listening thread.
>>
>> Are there any other resources that need to be freed up? Is there  
>> some  case that would cause the Snmp constructor to hang?
>>
>> Thanks,
>>
>> Norman Elton
>>
>> _______________________________________________
>> SNMP4J mailing list
>> SNMP4J at agentpp.org
>> http://lists.agentpp.org/mailman/listinfo/snmp4j
>>
>>
>
>
>




More information about the SNMP4J mailing list