[SNMP4J] Freezing when creating an Snmp object

Norman Elton normelton at gmail.com
Wed Jun 15 15:46:01 CEST 2005


Frank,

I found the posting you mentioned (April & May 2004). It seems that  
Zhan Yi found that a call to "sr.nextBytes(rnd);" was taking all the  
time. I checked, and my problem is the same.

I don't need v3 (or even v2c) support, so I'm going to make a  
subclass of snmp as you mentioned to disable these versions.

Any other ideas? Thanks for your help,

Norman


On Jun 13, 2005, at 6:18 PM, Frank Fock wrote:

> Norman,
>
> May be it's the random bug then. Someone reported a problem
> with the random seed initializing function on a Linux distribution  
> (Redhat?).
> The solution should be in the mailing list archive... somewhere...
>
> Best regards,
> Frank
>
> Norman Elton wrote:
>
>
>> 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