On Mon, 12 Sep 2005, Wes Hardaker wrote:
>
> Peder> run_alarms();
>
> Whoops. I just noticed that you put that into the library function.
> I read the code too fast and assumed you put it in your code instead.
>
> What you should do is put a call to that function inside *your* select
> loop. It should be called regardless of whether or not select returned
> a timeout or a packet once per loop.
Thank you very much for your answer. It seems to work equally well
although I don't really understand why you prefer this solution. In
snmp_select_info general alarms and session-internal requests are
processed in similar way, both adding to the calculation of the time to
wait. Why can they not be processed in similar way on return of select
statement?
I note, however, that this is the way agent_check_and_process is
implemented. So whatever the reason, your suggestion is the tested way of
doing things - the worst negative side effect is a slight waste of CPU
cycles.
I suggest that description of the run_alarms function is added to the
SNMP_API man page. What you tell me here is actually, that run_alarms is
a public function wrt agent programming - but it is not described anywhere
in the manuals. OK, man page snmp_alarm has a note about it, but that is
not the place you would look when you are coding the central select
statement of your application.
best regards
--
Peder Chr. Nørgaard Senior System Developer, M. Sc.
Ericsson Denmark A/S, Telebit Division
Skanderborgvej 232 tel: +45 30 91 84 31
DK-8260 Viby J, Denmark fax: +45 89 38 51 01
e-mail: [EMAIL PROTECTED]
(old e-mail 2000-2003: [EMAIL PROTECTED])
(old e-mail 1992-2000: [EMAIL PROTECTED])
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders