Rob,

Thanks for looking into this and getting this resolved so quickly! The
new version works perfectly. I was afraid I had went off on an odd
(maybe more accurately "dead wrong") tangent with this one. :)

- Kenny

-----Original Message-----
From: Rob Bloodgood [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 12, 2006 11:43 AM
To: Kenneth Flegal; POE
Subject: Re: PoCo::SNMP keeping requesting sessions alive for too long
due to postback

Kenneth Flegal wrote:
>
> From what I have seen, when I call finish on a session for PoCo::SNMP 
> I am unable to start a session for that same host again for the life 
> of the program. The first request would work every time without fail 
> but any subsequent requests made after creating a new PoCo::SNMP 
> session for this host would never make the postback. I am now using 
> the hostname the session is for as the alias of the PoCo::SNMP session

> and detaching the session from the first session that created the 
> session and using the session with that alias if it has already been 
> spawned.
>
> I am fine with keeping the PoCo::SNMP session alive throughout the 
> life of the program as every connection that I make will be used 
> frequently so long as it isn't keeping other sessions alive without 
> cause. With PoCo::SNMP using a postback that is passed along in the 
> anonymous sub used as the callback (which is referenced permanently in

> the Net::SNMP session) however, it will keep the calling session alive

> until a call is made from another session or the finish is called. I 
> believe I have a fix for this problem by simply adding a line to the 
> anonymous sub that sets the postback reference to undef after calling 
> the postback. I haven't seen any side effects from making this change 
> but wanted to bring it up on this list to make sure that I am not 
> missing something important and to include the patch in the case that 
> this is a useful change. Any comments on this would be greatly 
> appreciated and I hope that this patch is useful.
>
> - Kenny Flegal
>
You have incorrectly identified the nature of the problem, as well as 
its solution. Turns out PoCo::SNMP had some bad logic involved when a 
session was closed, causing it to *stay* "closed," even when you started

a new, different instance of it. I fixed that last nite and a new 
version of the component is on CPAN. Try your program with the new 
version, and feel free to email me personally if you have any additional

issues.

L8r,
Rob

Reply via email to