Re: How to do create a net-snmp subagent without infinite while loop

Dave Shield <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
On Wed, 2005-12-14 at 11:53 +0530, Simon Saha wrote:
>  But as your tutorial suggest my subagent has to be stuck
> in an infinite while loop waiting for SNMP request, like the following.
> 
>  while(keep_running) {
>     agent_check_and_process(1); /* 0 == don't block */
>   }

No - that's not a fundamental requirement.
The subagent does need to check for incoming requests on
a regular basis, and the easiest way to do this is with
an infinite loop.

But if you've already got a main event loop in your application,
then you can simply insert a call to

      agent_check_and_process(0);

within that loop, and things should work fine.



Dave

> ***********************  FSS-Unclassified   ***********************
> 
> "DISCLAIMER: This message is proprietary to Flextronics Software
> Systems Limited (FSS) and is intended solely for the use of the
> individual to whom it is addressed. It may contain  privileged or
> confidential information and should not be circulated or used for
> any purpose other than for what it is intended. If you have received
> this message in  error, please notify the originator immediately.
> If you are not the intended recipient, you are notified that you are
> strictly  prohibited  from  using, copying, altering, or disclosing
> the contents of this message.  FSS  accepts no  responsibility  for
> loss or damage arising from the use of  the information transmitted
> by this email including damage from virus."

DISCLAIMER:  This message is not proprietary to any institution
(whatever "proprietary" means in the context of email messages), and
is intended for the use of anyone who may find it of relevance. It
does not contain privileged or confidential information, and may be
circulated for any purpose that seems appropriate. If you have received
this message in error, simply delete it - don't both notifying the
originator, who is not interested in the slightest.  If you are not
the intended recipient, but find the information of interest, you are
strictly encouraged [sic] to use, copy, alter or disclose the contents
of this message.  Neither the University of Liverpool nor Dave Shield
accept any responsibility for loss or damage arising from the use of the
information transmitted by this email including damage from virus [sic],
which is the only sensible (if somewhat ungrammatical) comment in the
preceding disclaimer.



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.