On Wed, Feb 14, 2007 at 01:17:05PM -0800, [EMAIL PROTECTED] wrote:
> I'm writing a program that, in essence, polls a number of devices 
> simultaneously.  They're slow to respond individually, and I have a lot to 
> go through - doing them sequentially would take forever.  I set up a 
> callback function and send my requests off via snmp_send(), use snmp_wait() 
> and everything is happy. 
> 
> However, in one case, while processing the async response in my callback 
> function, I need to fetch a different piece of information before I can 
> finish with processing.  I make an entire new SNMP session, and send it off 
> to snmp_synch_response. 
> 
> Unfortuantely, snmp_synch_response never returns - it looks like it sends 
> the request off and uses snmp_wait(), but that unfortuantely just goes back 
> to processing the async responses.  This eventually just blows over the 
> stack (hitting bt in gdb and getting 500+ stack frames is not a pleasant 
> experience). 
> 
> Right now, I'm looking at having to just call the command-line snmpget to do 
> what I want (it would be rather difficult to get this fed back into the 
> async processing) - is that the only solution to this?  Is there a way to 
> get NET-SNMP to ignore the async requests while its supposed to be 
> processing the single sync request? 

The proper way to handle this is to have an object per device, and work
with a *list* of things you need to poll. You'll kick the process for
one request by transacting the first OID, and during the callback process
mark that one as finished.

Then, in the main loop having finished the first OID, you'll kick off the
second.

Steve

--- 
Stephen J Friedl | Security Consultant |  UNIX Wizard  |   +1 714 544-6561
www.unixwiz.net  | Tustin, Calif. USA  | Microsoft MVP | [EMAIL PROTECTED]

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to